diff --git a/iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.m b/iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.m index 8117473f3..113dcb785 100644 --- a/iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.m +++ b/iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.m @@ -42,7 +42,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSLog(@"Bundle URL: %@", [[NSBundle mainBundle] bundleURL]); - [OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_NONE]; + [OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_ERROR]; OneSignal.inFocusDisplayType = OSNotificationDisplayTypeInAppAlert; @@ -98,7 +98,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( + (NSString*)getOneSignalAppId { NSString* onesignalAppId = [[NSUserDefaults standardUserDefaults] objectForKey:ONESIGNAL_APP_ID_KEY_FOR_TESTING]; if (!onesignalAppId) - onesignalAppId = @"77e32082-ea27-42e3-a898-c72e141824ef"; + onesignalAppId = @"0ba9731b-33bd-43f4-8b59-61172e27447d"; return onesignalAppId; } diff --git a/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/Headers/OneSignal.h index 1f7c48897..05e5f06ac 100755 --- a/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/Headers/OneSignal.h @@ -44,12 +44,7 @@ ***/ #import - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 -#define XC8_AVAILABLE 1 #import -#endif - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wstrict-prototypes" @@ -73,6 +68,26 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { OSNotificationDisplayTypeNotification }; +@interface OSInAppMessageAction : NSObject + +// The action name attached to the IAM action +@property (strong, nonatomic, nullable) NSString *clickName; + +// The URL (if any) that should be opened when the action occurs +@property (strong, nonatomic, nullable) NSURL *clickUrl; + +// Whether or not the click action is first click on the IAM +@property (nonatomic) BOOL firstClick; + +// Whether or not the click action dismisses the message +@property (nonatomic) BOOL closesMessage; + +@end + +@protocol OSInAppMessageDelegate +@optional +- (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:)); +@end @interface OSNotificationAction : NSObject @@ -155,7 +170,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { /* Parses an APS push payload into a OSNotificationPayload object. Useful to call from your NotificationServiceExtension when the didReceiveNotificationRequest:withContentHandler: method fires. */ -+(instancetype)parseWithApns:(nonnull NSDictionary*)message; ++ (instancetype)parseWithApns:(nonnull NSDictionary*)message; @end @@ -181,11 +196,8 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { @property(readonly, getter=isSilentNotification)BOOL silentNotification; /* iOS 10+: Indicates whether or not the received notification has mutableContent : 1 assigned to its payload - Used for UNNotificationServiceExtension to launch extension. -*/ -#if XC8_AVAILABLE + Used for UNNotificationServiceExtension to launch extension. */ @property(readonly, getter=hasMutableContent)BOOL mutableContent; -#endif /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ - (NSString*)stringify; @@ -218,16 +230,6 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionProvisional }; -typedef void (^OSNotificationDisplayTypeResponse)(OSNotificationDisplayType displayType); - -// Notification Display Type Delegate -// Allows apps to customize per-notification display-type -@protocol OSNotificationDisplayTypeDelegate -- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload - withCompletion:(OSNotificationDisplayTypeResponse)completion; -@end - - // Permission Classes @interface OSPermissionState : NSObject @@ -318,6 +320,9 @@ typedef void (^OSHandleNotificationReceivedBlock)(OSNotification* notification); /*Block for handling a user reaction to a notification*/ typedef void (^OSHandleNotificationActionBlock)(OSNotificationOpenedResult * result); +/*Block for handling user click on an in app message*/ +typedef void (^OSHandleInAppMessageActionClickBlock)(OSInAppMessageAction* action); + /*Dictionary of keys to pass alongside the init settings*/ /*Let OneSignal directly prompt for push notifications on init*/ @@ -415,10 +420,6 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + (OSPermissionSubscriptionState*)getPermissionSubscriptionState; -// When the app is in-focus, this allows you to add a delegate that can customize the -// display type for specific notifications -+ (void)setNotificationDisplayTypeDelegate:(NSObject*)delegate; - + (void)addPermissionObserver:(NSObject*)observer; + (void)removePermissionObserver:(NSObject*)observer; @@ -429,6 +430,8 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + (void)setSubscription:(BOOL)enable; ++ (BOOL)isInAppMessagingPaused; ++ (void)pauseInAppMessages:(BOOL)pause; // - Posting Notification + (void)postNotification:(NSDictionary*)jsonData; @@ -444,6 +447,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { // Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. + (void)setMSDKType:(NSString*)type; ++ (void)setInAppMessageClickHandler:(OSHandleInAppMessageActionClickBlock)delegate; // iOS 10 only // Process from Notification Service Extension. @@ -474,6 +478,14 @@ typedef void (^OSEmailSuccessBlock)(); + (void)setEmail:(NSString * _Nonnull)email; + (void)setEmail:(NSString * _Nonnull)email withEmailAuthHashToken:(NSString * _Nullable)hashToken; +// In App Messaging Trigger methods ++ (void)addTrigger:(NSString * _Nonnull)key withValue:(id _Nonnull)value; ++ (void)addTriggers:(NSDictionary * _Nonnull)triggers; ++ (void)removeTriggerForKey:(NSString * _Nonnull)key; ++ (void)removeTriggersForKeys:(NSArray * _Nonnull)keys; ++ (NSDictionary * _Nonnull)getTriggers; ++ (id _Nullable)getTriggerValueForKey:(NSString * _Nonnull)key; + + (void)setExternalUserId:(NSString * _Nonnull)externalId; + (void)removeExternalUserId; diff --git a/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/OneSignal index 7269821fd..e33bb6c15 100755 Binary files a/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/OneSignal and b/iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework/Versions/A/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h index 1f7c48897..05e5f06ac 100755 --- a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h @@ -44,12 +44,7 @@ ***/ #import - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 -#define XC8_AVAILABLE 1 #import -#endif - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wstrict-prototypes" @@ -73,6 +68,26 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { OSNotificationDisplayTypeNotification }; +@interface OSInAppMessageAction : NSObject + +// The action name attached to the IAM action +@property (strong, nonatomic, nullable) NSString *clickName; + +// The URL (if any) that should be opened when the action occurs +@property (strong, nonatomic, nullable) NSURL *clickUrl; + +// Whether or not the click action is first click on the IAM +@property (nonatomic) BOOL firstClick; + +// Whether or not the click action dismisses the message +@property (nonatomic) BOOL closesMessage; + +@end + +@protocol OSInAppMessageDelegate +@optional +- (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:)); +@end @interface OSNotificationAction : NSObject @@ -155,7 +170,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { /* Parses an APS push payload into a OSNotificationPayload object. Useful to call from your NotificationServiceExtension when the didReceiveNotificationRequest:withContentHandler: method fires. */ -+(instancetype)parseWithApns:(nonnull NSDictionary*)message; ++ (instancetype)parseWithApns:(nonnull NSDictionary*)message; @end @@ -181,11 +196,8 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { @property(readonly, getter=isSilentNotification)BOOL silentNotification; /* iOS 10+: Indicates whether or not the received notification has mutableContent : 1 assigned to its payload - Used for UNNotificationServiceExtension to launch extension. -*/ -#if XC8_AVAILABLE + Used for UNNotificationServiceExtension to launch extension. */ @property(readonly, getter=hasMutableContent)BOOL mutableContent; -#endif /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ - (NSString*)stringify; @@ -218,16 +230,6 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionProvisional }; -typedef void (^OSNotificationDisplayTypeResponse)(OSNotificationDisplayType displayType); - -// Notification Display Type Delegate -// Allows apps to customize per-notification display-type -@protocol OSNotificationDisplayTypeDelegate -- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload - withCompletion:(OSNotificationDisplayTypeResponse)completion; -@end - - // Permission Classes @interface OSPermissionState : NSObject @@ -318,6 +320,9 @@ typedef void (^OSHandleNotificationReceivedBlock)(OSNotification* notification); /*Block for handling a user reaction to a notification*/ typedef void (^OSHandleNotificationActionBlock)(OSNotificationOpenedResult * result); +/*Block for handling user click on an in app message*/ +typedef void (^OSHandleInAppMessageActionClickBlock)(OSInAppMessageAction* action); + /*Dictionary of keys to pass alongside the init settings*/ /*Let OneSignal directly prompt for push notifications on init*/ @@ -415,10 +420,6 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + (OSPermissionSubscriptionState*)getPermissionSubscriptionState; -// When the app is in-focus, this allows you to add a delegate that can customize the -// display type for specific notifications -+ (void)setNotificationDisplayTypeDelegate:(NSObject*)delegate; - + (void)addPermissionObserver:(NSObject*)observer; + (void)removePermissionObserver:(NSObject*)observer; @@ -429,6 +430,8 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + (void)setSubscription:(BOOL)enable; ++ (BOOL)isInAppMessagingPaused; ++ (void)pauseInAppMessages:(BOOL)pause; // - Posting Notification + (void)postNotification:(NSDictionary*)jsonData; @@ -444,6 +447,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { // Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. + (void)setMSDKType:(NSString*)type; ++ (void)setInAppMessageClickHandler:(OSHandleInAppMessageActionClickBlock)delegate; // iOS 10 only // Process from Notification Service Extension. @@ -474,6 +478,14 @@ typedef void (^OSEmailSuccessBlock)(); + (void)setEmail:(NSString * _Nonnull)email; + (void)setEmail:(NSString * _Nonnull)email withEmailAuthHashToken:(NSString * _Nullable)hashToken; +// In App Messaging Trigger methods ++ (void)addTrigger:(NSString * _Nonnull)key withValue:(id _Nonnull)value; ++ (void)addTriggers:(NSDictionary * _Nonnull)triggers; ++ (void)removeTriggerForKey:(NSString * _Nonnull)key; ++ (void)removeTriggersForKeys:(NSArray * _Nonnull)keys; ++ (NSDictionary * _Nonnull)getTriggers; ++ (id _Nullable)getTriggerValueForKey:(NSString * _Nonnull)key; + + (void)setExternalUserId:(NSString * _Nonnull)externalId; + (void)removeExternalUserId; diff --git a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal index 2a81233ed..0ddbeee57 100644 Binary files a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal and b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal differ