+#endif
+
+@class Pushbots;
+
+/*!
+ @class
+ PushBots SDK v2.4.6
+ @abstract
+ The primary interface for integrating PushBots with your app.
+
+
+//in AppDelegate.h:
+@property (strong, nonatomic) Pushbots *PushbotsClient;
+//in AppDelegate.m
+ NSString *appID = @"56c3515f357e71aa0a0";
+ self.PushbotsClient = [Pushbots sharedInstanceWithAppId:appID andLoggingEnabled:YES];
+
+
+ For more advanced usage, please see the PushBots iOS SDK integration.
+ */
+
+
+@interface Pushbots : NSObject
+/**
+ * Pushbots log levels.
+ */
+typedef NS_ENUM(NSUInteger, PBLogLevel) {
+ PBLogLevelNoLogging, PBLogLevelError, PBLogLevelWarn, PBLogLevelInfo, PBLogLevelVerbose
+};
++ (NSDictionary*) currentlyShowingNotification;
++ (NSString*)applicationId;
++ (NSString*)deviceId;
++ (BOOL) prompt;
++ (BOOL) receivedCallback;
+
+typedef void (^PushBotsReceivedNotification)(NSDictionary * result);
+typedef void (^PushBotsOpenedNotification)(NSDictionary * result);
+typedef void (^PushBotsRegistered)(NSString * userid);
+
++ (void) onRegistered:(PushBotsRegistered)rCallback;
+
+
+/*!
+ @method
+
+ @abstract
+ Initializes an instance of the API.
+
+ @discussion
+ Initializes an instance of the PushBots.
+
+ @param appId Pushbots Application ID.
+ @param launchOptions launchOptions
+ */
++(id)initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions;
+
+/*!
+ @method
+
+ @abstract
+ Initializes an instance of the API.
+
+ @discussion
+ Initializes an instance of the PushBots.
+
+ @param appId Pushbots Application ID.
+ @param launchOptions launchOptions
+ @param prompt Push notification prompt on first app open.
+
+ */
++ (id)initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions prompt:(BOOL)prompt;
++ (id)initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions prompt:(BOOL)p receivedNotification:(PushBotsReceivedNotification)rCallback openedNotification:(PushBotsOpenedNotification)oCallback;
+
+/*!
+ @method
+
+ @abstract
+ Initializes an instance of the API.
+
+ @discussion
+ Initializes an instance of the PushBots.
+
+ @param appId Pushbots Application ID.
+ @param launchOptions launchOptions
+ @param p Push notification prompt on first app open.
+ @param rCallback block to access notification data on received.
+ */
++ (id)initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions prompt:(BOOL)p receivedNotification:(PushBotsReceivedNotification)rCallback;
+
+
++ (void)notificationReceived:(NSDictionary*)messageDict;
+/*!
+ @method
+
+ @discussion
+ Set PuhsBots SDK log level
+ [Pushbots setLogLevel:PBLogLevelVerbose];
+
+ @param pbloglevel PBLogLevelNoLogging, PBLogLevelVerbose, PBLogLevelInfo, PBLogLevelWarn, PBLogLevelError
+
+ */
++ (void)setLogLevel:(PBLogLevel)pbloglevel;
++ (void)setLogLevel:(PBLogLevel)pbloglevel isUILog:(BOOL)uiLog;
+/*!
+ @method
+
+ @discussion
+Show prompt to register with remote notifications.
+ */
++ (void)registerForRemoteNotifications;
+
+
+/*!
+ @method
+
+ @abstract
+ Registers device with all its data on PushBots servers, and increment sessions count, updates last session date.
+
+ @discussion
+ This method should be called in application:didRegisterForRemoteNotificationsWithDeviceToken:
to register the device on PushBots servers.
+
+ @param deviceToken Device token from Apple servers.
+ */
++ (void) registerOnPushbots:(NSData *)deviceToken;
+
+/*!
+ @method
+
+ @abstract
+ Get device data from Pushbots.
+
+ @discussion
+ This method will request device data from PushBots servers, should be used to sync tags/alias.
+
+ @param callback callback block to get device data as NSDictionary
+ */
++ (void) getDevice:(void (^)(NSDictionary *device, NSError *error))callback;
++ (void) checkInApp:(void (^)(NSArray *inappmessages, NSError *error))callback;
++(void) inAppNotificationOpenedWithId:(NSString *) inapp_id;
+
+/*!
+ @method
+
+ @abstract
+Update device data on Pushbots.
+
+ @discussion
+ This method will update device data on PushBots.
+ Device data keys:
+ tags: (array) set device tags.
+ tags_add: (array) add tags.
+ tags_remove: (array) remove tags.
+ alias: (String) set device alias.
+ badge: (Integer) set device badge.
+ badge_p: (Integer) Increment device badge.
+ badge_d: (Integet) decrement device badge.
+ debug: (Boolean) Set device debug status for sandbox.
+ subscribed: (Boolean) subscribe/unsubscribe from Push notifications.
+ location: (array)[lat, lng] update device location.
+
+ @param deviceObject NSDictionary with device data to be updated.
+ */
++ (void) update:(NSDictionary *)deviceObject;
+
+/*!
+ @method
+
+ @discussion
+This method will toggle debug mode on the device, visit sandbox section in dashboard for more details.
+
+ @param debug Toggle debug mode for sandboxing.
+ */
++ (void) debug:(BOOL)debug;
+
+/*!
+ @method
+
+ @discussion
+ This method will update device alias on PushBots.
+
+ @param alias device alias.
+ */
++ (void) setAlias:(NSString *)alias;
+
++ (void) setName:(NSString *)name;
++ (void) setFirstName:(NSString *)f_name;
++ (void) setLastName:(NSString *)l_name;
++ (void) setEmail:(NSString *)email;
++ (void) setGender:(NSString *)gender;
++ (void) setPhone:(NSString *)phone;
+
+
+
+/*!
+ @method
+
+ @discussion
+ This method will remove device alias from PushBots.
+
+ */
++ (void) removeAlias;
+
+
+/*!
+ @method
+
+ @discussion
+ This method will add tags to the device info.
+
+ @param tags Array of device tags to be added to the device.
+ */
++ (void) tag:(NSArray *)tags;
+
+/*!
+ @method
+
+ @discussion
+ This method will remove tags from device info.
+
+ @param tags Array of device tags to be removed from the device.
+ */
++ (void) untag:(NSArray *)tags;
+
+/*!
+ @method
+
+ @discussion
+ This method will set badge count on Pushbots and in the app (applicationIconBadgeNumber).
+
+ @param number New badge count.
+ */
++ (void) setBadge: (int) number;
+
+/*!
+ @method
+
+ @discussion
+ This method will increment badge count on PushBots and in the app (applicationIconBadgeNumber).
+
+ @param number badge count to add.
+ */
++ (void) incrementBadgeCountBy: (int) number;
+
+/*!
+ @method
+
+ @discussion
+ This method will decrement badge count on PushBots and in the app (applicationIconBadgeNumber).
+
+ @param number badge count to substract.
+ */
++ (void) decrementBadgeCountBy: (int) number;
+
+/*!
+ @method
+
+ @discussion
+ This method will Clear badge count on PushBots and in the app (applicationIconBadgeNumber).
+
+ */
++ (void) clearBadgeCount;
+
++ (void)openURL:(NSDictionary *)userInfo;
+
+/*!
+ @method
+
+ @discussion
+ This method will toggle Push notification subscription status.
+ @param subscribed badge count to substract.
+
+ */
++ (void) toggleNotifications:(BOOL)subscribed;
++ (BOOL)showTakeoverNotificationWithObject:(NSDictionary *) notification;
++ (void)showTakeoverNotificationWith:(NSDictionary *) notification;
++ (BOOL) validateInAppMessage:(NSDictionary *) message;
+
++ (void) trackPushNotificationOpenedWithLaunchOptions:(NSDictionary *) launchOptions;
++ (void) trackPushNotificationOpenedWithPayload:(NSDictionary *) payload;
++ (void) trackPushNotificationOpenedWithPoll:(NSDictionary *) payload andAnswerId:(NSString *)ansewerID sync:(BOOL) sync;
+
++(void) trackEvent:(NSString *)event;
++(void) trackEvent:(NSString *)event withValue:(NSString *)value;
++(void) shareLocation:(BOOL)isSharingEnabled;
++(void) shareLocationPrompt:(BOOL)isPrompt;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+#ifdef IOS10PLUS
+// iOS 10 only
+// Notification Service Extension
++ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest*)request withContent:(UNMutableNotificationContent*)replacementContent;
++ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest*)request withContent:(UNMutableNotificationContent*)replacementContent;
+
+#endif
+#pragma clang diagnostic pop
+
+@end
diff --git a/ios/Pushbots.framework/Versions/A/Modules/module.modulemap b/ios/Pushbots.framework/Versions/A/Modules/module.modulemap
new file mode 100644
index 0000000..adc5736
--- /dev/null
+++ b/ios/Pushbots.framework/Versions/A/Modules/module.modulemap
@@ -0,0 +1,5 @@
+framework module Pushbots {
+ umbrella header "Pushbots.h"
+ export *
+ module * { export * }
+}
diff --git a/ios/Pushbots.framework/Versions/A/Pushbots b/ios/Pushbots.framework/Versions/A/Pushbots
new file mode 100644
index 0000000..32f0ca7
Binary files /dev/null and b/ios/Pushbots.framework/Versions/A/Pushbots differ
diff --git a/ios/Pushbots.framework/Versions/Current b/ios/Pushbots.framework/Versions/Current
new file mode 100644
index 0000000..7d27390
Binary files /dev/null and b/ios/Pushbots.framework/Versions/Current differ
diff --git a/ios/Pushbots.framework/inAppMessageLayout~ipad.nib/objects-13.0+.nib b/ios/Pushbots.framework/inAppMessageLayout~ipad.nib/objects-13.0+.nib
new file mode 100644
index 0000000..1dac864
Binary files /dev/null and b/ios/Pushbots.framework/inAppMessageLayout~ipad.nib/objects-13.0+.nib differ
diff --git a/ios/Pushbots.framework/inAppMessageLayout~ipad.nib/runtime.nib b/ios/Pushbots.framework/inAppMessageLayout~ipad.nib/runtime.nib
new file mode 100644
index 0000000..cfa2c0c
Binary files /dev/null and b/ios/Pushbots.framework/inAppMessageLayout~ipad.nib/runtime.nib differ
diff --git a/ios/Pushbots.framework/inAppMessageLayout~landscape.nib/objects-13.0+.nib b/ios/Pushbots.framework/inAppMessageLayout~landscape.nib/objects-13.0+.nib
new file mode 100644
index 0000000..8718e69
Binary files /dev/null and b/ios/Pushbots.framework/inAppMessageLayout~landscape.nib/objects-13.0+.nib differ
diff --git a/ios/Pushbots.framework/inAppMessageLayout~landscape.nib/runtime.nib b/ios/Pushbots.framework/inAppMessageLayout~landscape.nib/runtime.nib
new file mode 100644
index 0000000..7bc63fb
Binary files /dev/null and b/ios/Pushbots.framework/inAppMessageLayout~landscape.nib/runtime.nib differ
diff --git a/ios/Pushbots.framework/inAppMessageLayout~portrait.nib/objects-13.0+.nib b/ios/Pushbots.framework/inAppMessageLayout~portrait.nib/objects-13.0+.nib
new file mode 100644
index 0000000..936e4d2
Binary files /dev/null and b/ios/Pushbots.framework/inAppMessageLayout~portrait.nib/objects-13.0+.nib differ
diff --git a/ios/Pushbots.framework/inAppMessageLayout~portrait.nib/runtime.nib b/ios/Pushbots.framework/inAppMessageLayout~portrait.nib/runtime.nib
new file mode 100644
index 0000000..e8104f5
Binary files /dev/null and b/ios/Pushbots.framework/inAppMessageLayout~portrait.nib/runtime.nib differ
diff --git a/ios/Pushbots.framework/placeholder-image.png b/ios/Pushbots.framework/placeholder-image.png
new file mode 100644
index 0000000..6ec8b86
Binary files /dev/null and b/ios/Pushbots.framework/placeholder-image.png differ
diff --git a/ios/RCTPushbots.h b/ios/RCTPushbots.h
index 7f1751b..88bfeb4 100644
--- a/ios/RCTPushbots.h
+++ b/ios/RCTPushbots.h
@@ -10,8 +10,10 @@
#else
#import "Pushbots.h"
#endif
-
-@interface RCTPushbots : NSObject
+#import
+@import WebKit;
+@import CoreTelephony;
+@interface RCTPushbots : RCTEventEmitter
- (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions;
- (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions prompt:(BOOL)prompt;
@end
diff --git a/ios/RCTPushbots.m b/ios/RCTPushbots.m
index 899d511..8c2046f 100644
--- a/ios/RCTPushbots.m
+++ b/ios/RCTPushbots.m
@@ -23,20 +23,23 @@ @interface RCTPushbots ()
@implementation RCTPushbots
-@synthesize bridge = _bridge;
-
RCT_EXPORT_MODULE()
-static RCTBridge *curRCTBridge;
-
-- (void)setBridge:(RCTBridge *)receivedBridge {
- _bridge = receivedBridge;
- curRCTBridge = receivedBridge;
-}
-
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
++ (instancetype)alloc{
+ static RCTPushbots *sharedInstance = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ sharedInstance = [super allocWithZone:nil];
+ });
+ return sharedInstance;
+}
+- (NSArray *)supportedEvents
+{
+ return @[@"Pushbots__RemoteNotificationReceived", @"Pushbots__RemoteNotificationOpened"];
+}
- (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions; {
NSLog(@"initWithAppId:");
@@ -45,7 +48,11 @@ - (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOp
- (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOptions prompt:(BOOL)prompt{
[Pushbots initWithAppId:appId withLaunchOptions:launchOptions prompt:prompt receivedNotification:^(NSDictionary *result) {
- [curRCTBridge.eventDispatcher sendAppEventWithName:@"Pushbots__RemoteNotificationReceived" body:result];
+ [self sendEventWithName:@"Pushbots__RemoteNotificationReceived" body: result];
+
+ } openedNotification:^(NSDictionary *result) {
+ [self sendEventWithName:@"Pushbots__RemoteNotificationOpened" body: result];
+
}];
return self;
}
@@ -96,8 +103,7 @@ - (id) initWithAppId:(NSString*)appId withLaunchOptions:(NSDictionary *)launchOp
RCT_EXPORT_METHOD(registerForRemoteNotifications)
{
- [Pushbots registerForRemoteNotifications];
- curRCTBridge = self.bridge;
+
}
diff --git a/ios/RCTPushbots.xcodeproj/project.pbxproj b/ios/RCTPushbots.xcodeproj/project.pbxproj
index 5264a8c..74a5e34 100644
--- a/ios/RCTPushbots.xcodeproj/project.pbxproj
+++ b/ios/RCTPushbots.xcodeproj/project.pbxproj
@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
BA89F5B4205BDE6D00ABDE84 /* libRCTPushbots.a in Copy Files */ = {isa = PBXBuildFile; fileRef = 134814201AA4EA6300B7C361 /* libRCTPushbots.a */; };
- BA89F5C8205BE0B000ABDE84 /* libPushbots.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA89F5C7205BE0B000ABDE84 /* libPushbots.a */; };
BA902CEF1FBDB18600574058 /* RCTPushbots.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RCTPushbots.m */; };
/* End PBXBuildFile section */
@@ -31,7 +30,6 @@
B3E7B5881CC2AC0600A0062D /* RCTPushbots.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPushbots.h; sourceTree = ""; };
B3E7B5891CC2AC0600A0062D /* RCTPushbots.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPushbots.m; sourceTree = ""; };
BA89F5B7205BDE9D00ABDE84 /* Pushbots.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Pushbots.h; sourceTree = ""; };
- BA89F5C7205BE0B000ABDE84 /* libPushbots.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libPushbots.a; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -39,7 +37,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- BA89F5C8205BE0B000ABDE84 /* libPushbots.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -54,13 +51,20 @@
name = Products;
sourceTree = "";
};
+ 52B07AD62448DD3A000EF4B8 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = Frameworks;
+ sourceTree = "";
+ };
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
- BA89F5C7205BE0B000ABDE84 /* libPushbots.a */,
BA89F5B7205BDE9D00ABDE84 /* Pushbots.h */,
B3E7B5881CC2AC0600A0062D /* RCTPushbots.h */,
B3E7B5891CC2AC0600A0062D /* RCTPushbots.m */,
+ 52B07AD62448DD3A000EF4B8 /* Frameworks */,
134814211AA4EA7D00B7C361 /* Products */,
);
sourceTree = "";
@@ -104,6 +108,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
+ English,
en,
);
mainGroup = 58B511D21A9E6C8500147676;
diff --git a/ios/RCTPushbots.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/RCTPushbots.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/ios/RCTPushbots.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/RCTPushbots.xcodeproj/project.xcworkspace/xcuserdata/macbookpro.xcuserdatad/UserInterfaceState.xcuserstate b/ios/RCTPushbots.xcodeproj/project.xcworkspace/xcuserdata/macbookpro.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..f024880
Binary files /dev/null and b/ios/RCTPushbots.xcodeproj/project.xcworkspace/xcuserdata/macbookpro.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/ios/RCTPushbots.xcodeproj/xcuserdata/macbookpro.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/RCTPushbots.xcodeproj/xcuserdata/macbookpro.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..c7e450a
--- /dev/null
+++ b/ios/RCTPushbots.xcodeproj/xcuserdata/macbookpro.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ SchemeUserState
+
+ RCTPushbots.xcscheme_^#shared#^_
+
+ orderHint
+ 0
+
+
+
+
diff --git a/ios/libPushbots.a b/ios/libPushbots.a
deleted file mode 100644
index 0ef9260..0000000
Binary files a/ios/libPushbots.a and /dev/null differ
diff --git a/pushbots-react-native.podspec b/pushbots-react-native.podspec
index c030151..6515eb1 100644
--- a/pushbots-react-native.podspec
+++ b/pushbots-react-native.podspec
@@ -13,5 +13,5 @@ Pod::Spec.new do |s|
s.static_framework = true
s.platform = :ios, "10.0"
s.dependency 'React', '>= 0.13.0', '< 1.0.0'
- s.dependency 'Pushbots', '2.4.3'
+ s.vendored_frameworks = 'ios/Pushbots.framework'
end
\ No newline at end of file