Skip to content

Commit

Permalink
Merge pull request #25 from blueshift-labs/optional
Browse files Browse the repository at this point in the history
push notification, analytics, location access made optional in the sdk
  • Loading branch information
anwarshahas authored May 31, 2017
2 parents c039c62 + 25ec945 commit 4f7e92a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions BlueShift-iOS-SDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "BlueShift-iOS-SDK"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "A short description of BlueShift-iOS-SDK."

s.description = <<-DESC
Expand Down Expand Up @@ -78,7 +78,7 @@ Pod::Spec.new do |s|
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/blueshift-labs/BlueShift-iOS-SDK.git", :tag => "0.1.4" }
s.source = { :git => "https://github.com/blueshift-labs/BlueShift-iOS-SDK.git", :tag => "0.1.5" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
17 changes: 11 additions & 6 deletions BlueShift-iOS-SDK/BlueShift.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ + (instancetype) sharedInstance {

+ (void) initWithConfiguration:(BlueShiftConfig *)config {
[[BlueShift sharedInstance] setupWithConfiguration:config];
// Start periodic batch upload timer
[BlueShiftHttpRequestBatchUpload startBatchUpload];
}

+ (void) autoIntegration {
Expand Down Expand Up @@ -63,10 +61,17 @@ - (void) setupWithConfiguration:(BlueShiftConfig *)config {
// setting the new delegate's old delegate with the original delegate we saved...
BlueShiftAppDelegate *blueShiftAppDelegate = (BlueShiftAppDelegate *)_newDelegate;
blueShiftAppDelegate.oldDelegate = oldDelegate;

[blueShiftAppDelegate registerForNotification];
[blueShiftAppDelegate registerLocationService];
[blueShiftAppDelegate handleRemoteNotificationOnLaunchWithLaunchOptions:config.applicationLaunchOptions];
if (config.enableAnalytics == YES) {
// Start periodic batch upload timer
[BlueShiftHttpRequestBatchUpload startBatchUpload];
}
if (config.enablePushNotification == YES) {
[blueShiftAppDelegate registerForNotification];
}
if (config.enableLocationAccess == YES) {
[blueShiftAppDelegate registerLocationService];
[blueShiftAppDelegate handleRemoteNotificationOnLaunchWithLaunchOptions:config.applicationLaunchOptions];
}

[BlueShiftNetworkReachabilityManager monitorNetworkConnectivity];
}
Expand Down
4 changes: 4 additions & 0 deletions BlueShift-iOS-SDK/BlueShiftConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
@property NSURL *cartPageURL;
@property NSURL *offerPageURL;

@property BOOL enablePushNotification;
@property BOOL enableLocationAccess;
@property BOOL enableAnalytics;

@property NSString *appGroupID;

- (BOOL)validateConfigDetails;
Expand Down
4 changes: 3 additions & 1 deletion BlueShift-iOS-SDK/BlueShiftConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ @implementation BlueShiftConfig
- (id)init {
self = [super init];
if (self) {

self.enablePushNotification = YES;
self.enableLocationAccess = YES;
self.enableAnalytics = YES;
}
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion BlueShift-iOS-SDK/SDKVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#ifndef SDKVersion_h
#define SDKVersion_h

#define kSDKVersionNumber @"0.1.4"
#define kSDKVersionNumber @"0.1.5"

#endif /* SDKVersion_h */

0 comments on commit 4f7e92a

Please sign in to comment.