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 def4b6e1a..2d8f00abb 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 @@ -135,6 +135,9 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { didReceiveNotificationRequest:withContentHandler: method fires. */ + (instancetype)parseWithApns:(nonnull NSDictionary*)message; +/* Convert object into a custom Dictionary / JSON Object */ +- (NSDictionary* _Nonnull)jsonRepresentation; + /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ - (NSString* _Nonnull)stringify; @@ -207,7 +210,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { // Pass in nil means a notification will not display typedef void (^OSNotificationDisplayResponse)(OSNotification* _Nullable notification); /* OneSignal Influence Types */ -typedef NS_ENUM(NSUInteger, Session) { +typedef NS_ENUM(NSUInteger, OSSession) { DIRECT, INDIRECT, UNATTRIBUTED, @@ -222,7 +225,7 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @interface OSOutcomeEvent : NSObject // Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params -@property (nonatomic) Session session; +@property (nonatomic) OSSession session; // Notification ids for the current session @property (strong, nonatomic, nullable) NSArray *notificationIds; @@ -252,7 +255,10 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionAuthorized, // the application is only authorized to post Provisional notifications (direct to history) - OSNotificationPermissionProvisional + OSNotificationPermissionProvisional, + + // the application is authorized to send notifications for 8 hours. Only used by App Clips. + OSNotificationPermissionEphemeral }; // Permission Classes @@ -281,8 +287,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { // Subscription Classes @interface OSSubscriptionState : NSObject -@property (readonly, nonatomic) BOOL subscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) -@property (readonly, nonatomic) BOOL userSubscriptionSetting; // returns setSubscription state. +@property (readonly, nonatomic) BOOL isSubscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) +@property (readonly, nonatomic) BOOL isPushDisabled; // returns value of disablePush. @property (readonly, nonatomic, nullable) NSString* userId; // AKA OneSignal PlayerId @property (readonly, nonatomic, nullable) NSString* pushToken; // AKA Apple Device Token - (NSDictionary* _Nonnull)toDictionary; @@ -292,7 +298,7 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @interface OSEmailSubscriptionState : NSObject @property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID @property (readonly, nonatomic, nullable) NSString *emailAddress; -@property (readonly, nonatomic) BOOL subscribed; +@property (readonly, nonatomic) BOOL isSubscribed; - (NSDictionary* _Nonnull)toDictionary; @end @@ -368,6 +374,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { */ @property (readonly, nullable) NSString* emailAddress; +@property (readonly) BOOL isEmailSubscribed; + - (instancetype)initWithSubscriptionState:(OSPermissionSubscriptionState *)state; // Convert the class into a NSDictionary @@ -492,7 +500,6 @@ typedef void (^OSInAppMessageClickBlock)(OSInAppMessageAction * _Nonnull action) #pragma mark Permission, Subscription, and Email Observers NS_ASSUME_NONNULL_BEGIN -+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState; + (void)addPermissionObserver:(NSObject*)observer; + (void)removePermissionObserver:(NSObject*)observer; diff --git a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal index 82672188b..5668d6c36 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 diff --git a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Resources/Info.plist b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Resources/Info.plist index 600aa3dc9..14bb67df9 100644 Binary files a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Resources/Info.plist and b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Resources/Info.plist differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist index dc33f4356..6bf8aae1a 100644 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist @@ -6,17 +6,17 @@ LibraryIdentifier - ios-armv7_armv7s_arm64 + ios-x86_64-maccatalyst LibraryPath OneSignal.framework SupportedArchitectures - armv7 - armv7s - arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + maccatalyst LibraryIdentifier @@ -35,17 +35,17 @@ LibraryIdentifier - ios-x86_64-maccatalyst + ios-armv7_armv7s_arm64 LibraryPath OneSignal.framework SupportedArchitectures - x86_64 + armv7 + armv7s + arm64 SupportedPlatform ios - SupportedPlatformVariant - maccatalyst CFBundlePackageType diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Headers/OneSignal.h index 8bed5da8a..2d8f00abb 100755 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Headers/OneSignal.h @@ -54,53 +54,41 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { OSNotificationActionTypeActionTaken }; -/* The way a notification was displayed to the user */ -typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { - /*Notification is silent, or app is in focus but InAppAlertNotifications are disabled*/ - OSNotificationDisplayTypeNone, - - /*Default UIAlertController display*/ - OSNotificationDisplayTypeInAppAlert, - - /*iOS native notification display*/ - OSNotificationDisplayTypeNotification -}; - @interface OSNotificationAction : NSObject /* The type of the notification action */ @property(readonly)OSNotificationActionType type; -/* The ID associated with the button tapped. NULL when the actionType is NotificationTapped or InAppAlertClosed */ -@property(readonly)NSString* actionID; +/* The ID associated with the button tapped. NULL when the actionType is NotificationTapped */ +@property(readonly, nullable)NSString* actionId; @end -/* Notification Payload Received Object */ -@interface OSNotificationPayload : NSObject +/* OneSignal OSNotification */ +@interface OSNotification : NSObject /* Unique Message Identifier */ -@property(readonly)NSString* notificationID; +@property(readonly, nullable)NSString* notificationId; /* Unique Template Identifier */ -@property(readonly)NSString* templateID; +@property(readonly, nullable)NSString* templateId; /* Name of Template */ -@property(readonly)NSString* templateName; +@property(readonly, nullable)NSString* templateName; -/* True when the key content-available is set to 1 in the aps payload. +/* True when the key content-available is set to 1 in the apns payload. content-available is used to wake your app when the payload is received. See Apple's documenation for more details. https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application */ @property(readonly)BOOL contentAvailable; -/* True when the key mutable-content is set to 1 in the aps payload. +/* True when the key mutable-content is set to 1 in the apns payload. mutable-content is used to wake your Notification Service Extension to modify a notification. See Apple's documenation for more details. https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension */ -@property(readonly)BOOL mutableContent; +@property(readonly, getter=hasMutableContent)BOOL mutableContent; /* Notification category key previously registered to display with. @@ -108,84 +96,63 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { See Apple's documenation for more details. https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW26 */ -@property(readonly)NSString* category; +@property(readonly, nullable)NSString* category; /* The badge assigned to the application icon */ -@property(readonly)NSUInteger badge; +@property(readonly)NSInteger badge; @property(readonly)NSInteger badgeIncrement; /* The sound parameter passed to the notification By default set to UILocalNotificationDefaultSoundName */ -@property(readonly)NSString* sound; +@property(readonly, nullable)NSString* sound; /* Main push content */ -@property(readonly)NSString* title; -@property(readonly)NSString* subtitle; -@property(readonly)NSString* body; +@property(readonly, nullable)NSString* title; +@property(readonly, nullable)NSString* subtitle; +@property(readonly, nullable)NSString* body; /* Web address to launch within the app via a WKWebView */ -@property(readonly)NSString* launchURL; +@property(readonly, nullable)NSString* launchURL; /* Additional key value properties set within the payload */ -@property(readonly)NSDictionary* additionalData; +@property(readonly, nullable)NSDictionary* additionalData; /* iOS 10+ : Attachments sent as part of the rich notification */ -@property(readonly)NSDictionary* attachments; +@property(readonly, nullable)NSDictionary* attachments; /* Action buttons passed */ -@property(readonly)NSArray *actionButtons; +@property(readonly, nullable)NSArray *actionButtons; /* Holds the original payload received Keep the raw value for users that would like to root the push */ -@property(readonly)NSDictionary *rawPayload; +@property(readonly, nonnull)NSDictionary *rawPayload; /* iOS 10+ : Groups notifications into threads */ -@property(readonly)NSString *threadId; +@property(readonly, nullable)NSString *threadId; -/* Parses an APS push payload into a OSNotificationPayload object. +/* Parses an APNS push payload into a OSNotification object. Useful to call from your NotificationServiceExtension when the didReceiveNotificationRequest:withContentHandler: method fires. */ + (instancetype)parseWithApns:(nonnull NSDictionary*)message; -@end - -/* OneSignal OSNotification */ -@interface OSNotification : NSObject - -/* Notification Payload */ -@property(readonly)OSNotificationPayload* payload; - -/* Display method of the notification */ -@property(readonly)OSNotificationDisplayType displayType; - -/* Set to true when the user was able to see the notification and reacted to it - Set to false when app is in focus and in-app alerts are disabled, or the remote notification is silent. */ -@property(readonly, getter=wasShown)BOOL shown; - -/* Set to true if the app was in focus when the notification */ -@property(readonly, getter=wasAppInFocus)BOOL isAppInFocus; - -/* Set to true when the received notification is silent - Silent means there is no alert, sound, or badge payload in the aps dictionary - requires remote-notification within UIBackgroundModes array of the Info.plist */ -@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. */ -@property(readonly, getter=hasMutableContent)BOOL mutableContent; +/* Convert object into a custom Dictionary / JSON Object */ +- (NSDictionary* _Nonnull)jsonRepresentation; /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ -- (NSString*)stringify; +- (NSString* _Nonnull)stringify; @end @interface OSNotificationOpenedResult : NSObject -@property(readonly)OSNotification* notification; -@property(readonly)OSNotificationAction *action; +@property(readonly, nonnull)OSNotification* notification; +@property(readonly, nonnull)OSNotificationAction *action; /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ -- (NSString*)stringify; +- (NSString* _Nonnull)stringify; + +// Convert the class into a NSDictionary +- (NSDictionary *_Nonnull)jsonRepresentation; @end; @@ -240,8 +207,10 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { - (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:)); @end +// Pass in nil means a notification will not display +typedef void (^OSNotificationDisplayResponse)(OSNotification* _Nullable notification); /* OneSignal Influence Types */ -typedef NS_ENUM(NSUInteger, Session) { +typedef NS_ENUM(NSUInteger, OSSession) { DIRECT, INDIRECT, UNATTRIBUTED, @@ -256,7 +225,7 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @interface OSOutcomeEvent : NSObject // Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params -@property (nonatomic) Session session; +@property (nonatomic) OSSession session; // Notification ids for the current session @property (strong, nonatomic, nullable) NSArray *notificationIds; @@ -275,7 +244,6 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @end - typedef NS_ENUM(NSInteger, OSNotificationPermission) { // The user has not yet made a choice regarding whether your app can show notifications. OSNotificationPermissionNotDetermined = 0, @@ -287,7 +255,10 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionAuthorized, // the application is only authorized to post Provisional notifications (direct to history) - OSNotificationPermissionProvisional + OSNotificationPermissionProvisional, + + // the application is authorized to send notifications for 8 hours. Only used by App Clips. + OSNotificationPermissionEphemeral }; // Permission Classes @@ -297,115 +268,119 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly, nonatomic) BOOL hasPrompted; @property (readonly, nonatomic) BOOL providesAppNotificationSettings; @property (readonly, nonatomic) OSNotificationPermission status; -- (NSDictionary*)toDictionary; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSPermissionStateChanges : NSObject -@property (readonly) OSPermissionState* to; -@property (readonly) OSPermissionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSPermissionState* to; +@property (readonly, nonnull) OSPermissionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges*)stateChanges; +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; @end - // Subscription Classes @interface OSSubscriptionState : NSObject -@property (readonly, nonatomic) BOOL subscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) -@property (readonly, nonatomic) BOOL userSubscriptionSetting; // returns setSubscription state. -@property (readonly, nonatomic) NSString* userId; // AKA OneSignal PlayerId -@property (readonly, nonatomic) NSString* pushToken; // AKA Apple Device Token -- (NSDictionary*)toDictionary; +@property (readonly, nonatomic) BOOL isSubscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) +@property (readonly, nonatomic) BOOL isPushDisabled; // returns value of disablePush. +@property (readonly, nonatomic, nullable) NSString* userId; // AKA OneSignal PlayerId +@property (readonly, nonatomic, nullable) NSString* pushToken; // AKA Apple Device Token +- (NSDictionary* _Nonnull)toDictionary; @end - @interface OSEmailSubscriptionState : NSObject -@property (readonly, nonatomic) NSString* emailUserId; // The new Email user ID -@property (readonly, nonatomic) NSString *emailAddress; -@property (readonly, nonatomic) BOOL subscribed; -- (NSDictionary*)toDictionary; +@property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID +@property (readonly, nonatomic, nullable) NSString *emailAddress; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSSubscriptionStateChanges : NSObject -@property (readonly) OSSubscriptionState* to; -@property (readonly) OSSubscriptionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSSubscriptionState* to; +@property (readonly, nonnull) OSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSEmailSubscriptionStateChanges : NSObject -@property (readonly) OSEmailSubscriptionState* to; -@property (readonly) OSEmailSubscriptionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSEmailSubscriptionState* to; +@property (readonly, nonnull) OSEmailSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @protocol OSSubscriptionObserver -- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges*)stateChanges; +- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @protocol OSEmailSubscriptionObserver -- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges*)stateChanges; +- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end - - // Permission+Subscription Classes @interface OSPermissionSubscriptionState : NSObject -@property (readonly) OSPermissionState* permissionStatus; -@property (readonly) OSSubscriptionState* subscriptionStatus; -@property (readonly) OSEmailSubscriptionState *emailSubscriptionStatus; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSPermissionState* permissionStatus; +@property (readonly, nonnull) OSSubscriptionState* subscriptionStatus; +@property (readonly, nonnull) OSEmailSubscriptionState *emailSubscriptionStatus; +- (NSDictionary* _Nonnull)toDictionary; @end -@interface OSDevice : NSObject +@interface OSDeviceState : NSObject /** * Get the app's notification permission * @return false if the user disabled notifications for the app, otherwise true */ -- (BOOL)isNotificationEnabled; +@property (readonly) BOOL hasNotificationPermission; /** * Get whether the user is subscribed to OneSignal notifications or not * @return false if the user is not subscribed to OneSignal notifications, otherwise true */ -- (BOOL)isUserSubscribed; +@property (readonly) BOOL isPushDisabled; /** * Get whether the user is subscribed * @return true if isNotificationEnabled, isUserSubscribed, getUserId and getPushToken are true, otherwise false */ -- (BOOL)isSubscribed; +@property (readonly) BOOL isSubscribed; /** * Get the user notification permision status * @return OSNotificationPermission */ -- (OSNotificationPermission)getNotificationPermissionStatus; +@property (readonly) OSNotificationPermission notificationPermissionStatus; /** * Get user id from registration (player id) - * @return user id if user is registered, otherwise false + * @return user id if user is registered, otherwise null */ -- (NSString*)getUserId; +@property (readonly, nullable) NSString* userId; /** * Get apple deice push token * @return push token if available, otherwise null */ -- (NSString*)getPushToken; +@property (readonly, nullable) NSString* pushToken; /** * Get the user email id * @return email id if user address was registered, otherwise null */ -- (NSString*)getEmailUserId; +@property (readonly, nullable) NSString* emailUserId; /** * Get the user email * @return email address if set, otherwise null */ -- (NSString*)getEmailAddress; +@property (readonly, nullable) NSString* emailAddress; + +@property (readonly) BOOL isEmailSubscribed; + +- (instancetype)initWithSubscriptionState:(OSPermissionSubscriptionState *)state; + +// Convert the class into a NSDictionary +- (NSDictionary *_Nonnull)jsonRepresentation; + @end typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen); @@ -414,157 +389,131 @@ typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen); typedef void (^OSResultSuccessBlock)(NSDictionary* result); typedef void (^OSFailureBlock)(NSError* error); -/*Block for notifying availability of the User's ID and push token*/ -typedef void (^OSIdsAvailableBlock)(NSString* userId, NSString* pushToken); - -/*Block for handling the reception of a remote notification */ -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); - /*Block for handling outcome event being sent successfully*/ typedef void (^OSSendOutcomeSuccess)(OSOutcomeEvent* outcome); /*Dictionary of keys to pass alongside the init settings*/ - -/*Let OneSignal directly prompt for push notifications on init*/ -extern NSString * const kOSSettingsKeyAutoPrompt; - -/*Enable the default in-app alerts*/ -extern NSString * const kOSSettingsKeyInAppAlerts; /*Enable In-App display of Launch URLs*/ extern NSString * const kOSSettingsKeyInAppLaunchURL; -/*Prompt user yes/no to open URL's from push notifications*/ -extern NSString * const kOSSSettingsKeyPromptBeforeOpeningPushURL; - -/* iOS 10 + - Set notification's in-focus display option. - Value must be an OSNotificationDisplayType enum -*/ -extern NSString * const kOSSettingsKeyInFocusDisplayOption; - - /* iOS 12 + Used to determine if the app is able to present it's own customized Notification Settings view */ extern NSString * const kOSSettingsKeyProvidesAppNotificationSettings; + + // ======= OneSignal Class Interface ========= @interface OneSignal : NSObject extern NSString* const ONESIGNAL_VERSION; -typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { - ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE -}; - ++ (NSString*)appId; ++ (NSString* _Nonnull)sdkVersionRaw; ++ (NSString* _Nonnull)sdkSemanticVersion; -/* - Initialize OneSignal. - Sends push token to OneSignal so you can later send notifications. - */ ++ (void)disablePush:(BOOL)disable; -// - Initialization -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback settings:(NSDictionary*)settings; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationReceived:(OSHandleNotificationReceivedBlock)receivedCallback handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback settings:(NSDictionary*)settings; ++ (NSString* _Nonnull)parseNSErrorAsJsonString:(NSError* _Nonnull)error; -// - Privacy -+ (void)consentGranted:(BOOL)granted; -+ (BOOL)requiresUserPrivacyConsent; // tells your application if privacy consent is still needed from the current user -+ (void)setRequiresUserPrivacyConsent:(BOOL)required; //used by wrapper SDK's to require user privacy consent +// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. ++ (void)setMSDKType:(NSString* _Nonnull)type; -@property (class) OSNotificationDisplayType inFocusDisplayType; +#pragma mark Initialization ++ (void)setAppId:(NSString* _Nonnull)newAppId; ++ (void)initWithLaunchOptions:(NSDictionary* _Nullable)launchOptions; +// TODO: Remove before releasing major release 3.0.0 ++ (void)setAppSettings:(NSDictionary* _Nonnull)settings; -+ (NSString*)app_id; -+ (NSString*)sdk_version_raw; -+ (NSString*)sdk_semantic_version; +#pragma mark Logging +typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + ONE_S_LL_NONE, + ONE_S_LL_FATAL, + ONE_S_LL_ERROR, + ONE_S_LL_WARN, + ONE_S_LL_INFO, + ONE_S_LL_DEBUG, + ONE_S_LL_VERBOSE +}; -// Only use if you set kOSSettingsKeyAutoPrompt to false -+ (void)registerForPushNotifications __deprecated_msg("Please use promptForPushNotificationsWithUserResponse instead."); -+ (void)promptForPushNotificationsWithUserResponse:(void(^)(BOOL accepted))completionHandler; -+ (void)promptForPushNotificationsWithUserResponse:(void (^)(BOOL accepted))completionHandler fallbackToSettings:(BOOL)fallback; ++ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel; ++ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString* _Nonnull)message; -// This method opens the iOS Settings app and navigates to the Push Notification Settings -// page for your app specifically -+ (void)presentAppSettings; -+ (void)registerForProvisionalAuthorization:(void(^)(BOOL accepted))completionHandler; +#pragma mark Prompt For Push +typedef void(^OSUserResponseBlock)(BOOL accepted); -// - Logging -+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel; -+ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString*)message; - -// - Tagging -+ (void)sendTag:(NSString*)key value:(NSString*)value onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)sendTag:(NSString*)key value:(NSString*)value; -+ (void)sendTags:(NSDictionary*)keyValuePair onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)sendTags:(NSDictionary*)keyValuePair; -+ (void)sendTagsWithJsonString:(NSString*)jsonString; -+ (void)getTags:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)getTags:(OSResultSuccessBlock)successBlock; -+ (void)deleteTag:(NSString*)key onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)deleteTag:(NSString*)key; -+ (void)deleteTags:(NSArray*)keys onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)deleteTags:(NSArray*)keys; -+ (void)deleteTagsWithJsonString:(NSString*)jsonString; -// Optional method that sends us the user's email as an anonymized hash so that we can better target and personalize notifications sent to that user across their devices. -// Sends as MD5 and SHA1 of the provided email -+ (void)syncHashedEmail:(NSString*)email __deprecated_msg("Please refer to our new Email methods/functionality such as setEmail(). This method will be removed in a future version of the OneSignal SDK"); - -// - Subscription and Permissions -+ (void)IdsAvailable:(OSIdsAvailableBlock)idsAvailableBlock __deprecated_msg("Please use getPermissionSubscriptionState or addSubscriptionObserver and addPermissionObserver instead."); - -+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState; -+ (OSDevice*)getUserDevice; ++ (void)promptForPushNotificationsWithUserResponse:(OSUserResponseBlock)block; ++ (void)promptForPushNotificationsWithUserResponse:(OSUserResponseBlock)block fallbackToSettings:(BOOL)fallback; ++ (void)registerForProvisionalAuthorization:(OSUserResponseBlock)block; ++ (OSDeviceState*)getDeviceState; -+ (void)addPermissionObserver:(NSObject*)observer; -+ (void)removePermissionObserver:(NSObject*)observer; +#pragma mark Privacy Consent ++ (void)consentGranted:(BOOL)granted; +// Tells your application if privacy consent is still needed from the current user ++ (BOOL)requiresUserPrivacyConsent; ++ (void)setRequiresUserPrivacyConsent:(BOOL)required; -+ (void)addSubscriptionObserver:(NSObject*)observer; -+ (void)removeSubscriptionObserver:(NSObject*)observer; +#pragma mark Public Handlers -+ (void)addEmailSubscriptionObserver:(NSObject*)observer; -+ (void)removeEmailSubscriptionObserver:(NSObject*)observer; +// If the completion block is not called within 25 seconds of this block being called in notificationWillShowInForegroundHandler then the completion will be automatically fired. +typedef void (^OSNotificationWillShowInForegroundBlock)(OSNotification * _Nonnull notification, OSNotificationDisplayResponse _Nonnull completion); +typedef void (^OSNotificationOpenedBlock)(OSNotificationOpenedResult * _Nonnull result); +typedef void (^OSInAppMessageClickBlock)(OSInAppMessageAction * _Nonnull action); -+ (void)setSubscription:(BOOL)enable; -+ (BOOL)isInAppMessagingPaused; -+ (void)pauseInAppMessages:(BOOL)pause; ++ (void)setNotificationWillShowInForegroundHandler:(OSNotificationWillShowInForegroundBlock _Nullable)block; ++ (void)setNotificationOpenedHandler:(OSNotificationOpenedBlock _Nullable)block; ++ (void)setInAppMessageClickHandler:(OSInAppMessageClickBlock _Nullable)block; -// - Posting Notification -+ (void)postNotification:(NSDictionary*)jsonData; -+ (void)postNotification:(NSDictionary*)jsonData onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)postNotificationWithJsonString:(NSString*)jsonData onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (NSString*)parseNSErrorAsJsonString:(NSError*)error; +#pragma mark Post Notification ++ (void)postNotification:(NSDictionary* _Nonnull)jsonData; ++ (void)postNotification:(NSDictionary* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)postNotificationWithJsonString:(NSString* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; +#pragma mark Location // - Request and track user's location + (void)promptLocation; + (void)setLocationShared:(BOOL)enable; + (BOOL)isLocationShared; - -// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. -+ (void)setMSDKType:(NSString*)type; - -+ (void)setInAppMessageClickHandler:(OSHandleInAppMessageActionClickBlock)delegate; - +#pragma mark NotificationService Extension // iOS 10 only // Process from Notification Service Extension. // Used for iOS Media Attachemtns and Action Buttons. -+ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; -+ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; ++ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent; ++ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent; + +#pragma mark Tags ++ (void)sendTag:(NSString* _Nonnull)key value:(NSString* _Nonnull)value onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)sendTag:(NSString* _Nonnull)key value:(NSString* _Nonnull)value; ++ (void)sendTags:(NSDictionary* _Nonnull)keyValuePair onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)sendTags:(NSDictionary* _Nonnull)keyValuePair; ++ (void)sendTagsWithJsonString:(NSString* _Nonnull)jsonString; ++ (void)getTags:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)getTags:(OSResultSuccessBlock _Nullable)successBlock; ++ (void)deleteTag:(NSString* _Nonnull)key onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)deleteTag:(NSString* _Nonnull)key; ++ (void)deleteTags:(NSArray* _Nonnull)keys onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)deleteTags:(NSArray *_Nonnull)keys; ++ (void)deleteTagsWithJsonString:(NSString* _Nonnull)jsonString; + +#pragma mark Permission, Subscription, and Email Observers +NS_ASSUME_NONNULL_BEGIN + ++ (void)addPermissionObserver:(NSObject*)observer; ++ (void)removePermissionObserver:(NSObject*)observer; + ++ (void)addSubscriptionObserver:(NSObject*)observer; ++ (void)removeSubscriptionObserver:(NSObject*)observer; -// Email methods ++ (void)addEmailSubscriptionObserver:(NSObject*)observer; ++ (void)removeEmailSubscriptionObserver:(NSObject*)observer; +NS_ASSUME_NONNULL_END +#pragma mark Email // Typedefs defining completion blocks for email & simultaneous HTTP requests -typedef void (^OSEmailFailureBlock)(NSError* error); +typedef void (^OSEmailFailureBlock)(NSError *error); typedef void (^OSEmailSuccessBlock)(); // Allows you to set the email for this user. @@ -583,16 +532,17 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; -// External user id +#pragma mark External User Id // Typedefs defining completion blocks for updating the external user id typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results); - + (void)setExternalUserId:(NSString * _Nonnull)externalId; + (void)setExternalUserId:(NSString * _Nonnull)externalId withCompletion:(OSUpdateExternalUserIdBlock _Nullable)completionBlock; + (void)removeExternalUserId; + (void)removeExternalUserId:(OSUpdateExternalUserIdBlock _Nullable)completionBlock; -// In-App Messaging triggers +#pragma mark In-App Messaging ++ (BOOL)isInAppMessagingPaused; ++ (void)pauseInAppMessages:(BOOL)pause; + (void)addTrigger:(NSString * _Nonnull)key withValue:(id _Nonnull)value; + (void)addTriggers:(NSDictionary * _Nonnull)triggers; + (void)removeTriggerForKey:(NSString * _Nonnull)key; @@ -600,7 +550,7 @@ typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results); + (NSDictionary * _Nonnull)getTriggers; + (id _Nullable)getTriggerValueForKey:(NSString * _Nonnull)key; -// Outcome Events +#pragma mark Outcomes + (void)sendOutcome:(NSString * _Nonnull)name; + (void)sendOutcome:(NSString * _Nonnull)name onSuccess:(OSSendOutcomeSuccess _Nullable)success; + (void)sendUniqueOutcome:(NSString * _Nonnull)name; diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Info.plist b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Info.plist index 57d66976b..a2ccc630c 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Info.plist and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/Info.plist differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/OneSignal b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/OneSignal index 62196b817..c3ffd2002 100755 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/OneSignal and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-armv7_armv7s_arm64/OneSignal.framework/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h index 8bed5da8a..2d8f00abb 100755 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h @@ -54,53 +54,41 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { OSNotificationActionTypeActionTaken }; -/* The way a notification was displayed to the user */ -typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { - /*Notification is silent, or app is in focus but InAppAlertNotifications are disabled*/ - OSNotificationDisplayTypeNone, - - /*Default UIAlertController display*/ - OSNotificationDisplayTypeInAppAlert, - - /*iOS native notification display*/ - OSNotificationDisplayTypeNotification -}; - @interface OSNotificationAction : NSObject /* The type of the notification action */ @property(readonly)OSNotificationActionType type; -/* The ID associated with the button tapped. NULL when the actionType is NotificationTapped or InAppAlertClosed */ -@property(readonly)NSString* actionID; +/* The ID associated with the button tapped. NULL when the actionType is NotificationTapped */ +@property(readonly, nullable)NSString* actionId; @end -/* Notification Payload Received Object */ -@interface OSNotificationPayload : NSObject +/* OneSignal OSNotification */ +@interface OSNotification : NSObject /* Unique Message Identifier */ -@property(readonly)NSString* notificationID; +@property(readonly, nullable)NSString* notificationId; /* Unique Template Identifier */ -@property(readonly)NSString* templateID; +@property(readonly, nullable)NSString* templateId; /* Name of Template */ -@property(readonly)NSString* templateName; +@property(readonly, nullable)NSString* templateName; -/* True when the key content-available is set to 1 in the aps payload. +/* True when the key content-available is set to 1 in the apns payload. content-available is used to wake your app when the payload is received. See Apple's documenation for more details. https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application */ @property(readonly)BOOL contentAvailable; -/* True when the key mutable-content is set to 1 in the aps payload. +/* True when the key mutable-content is set to 1 in the apns payload. mutable-content is used to wake your Notification Service Extension to modify a notification. See Apple's documenation for more details. https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension */ -@property(readonly)BOOL mutableContent; +@property(readonly, getter=hasMutableContent)BOOL mutableContent; /* Notification category key previously registered to display with. @@ -108,84 +96,63 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { See Apple's documenation for more details. https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW26 */ -@property(readonly)NSString* category; +@property(readonly, nullable)NSString* category; /* The badge assigned to the application icon */ -@property(readonly)NSUInteger badge; +@property(readonly)NSInteger badge; @property(readonly)NSInteger badgeIncrement; /* The sound parameter passed to the notification By default set to UILocalNotificationDefaultSoundName */ -@property(readonly)NSString* sound; +@property(readonly, nullable)NSString* sound; /* Main push content */ -@property(readonly)NSString* title; -@property(readonly)NSString* subtitle; -@property(readonly)NSString* body; +@property(readonly, nullable)NSString* title; +@property(readonly, nullable)NSString* subtitle; +@property(readonly, nullable)NSString* body; /* Web address to launch within the app via a WKWebView */ -@property(readonly)NSString* launchURL; +@property(readonly, nullable)NSString* launchURL; /* Additional key value properties set within the payload */ -@property(readonly)NSDictionary* additionalData; +@property(readonly, nullable)NSDictionary* additionalData; /* iOS 10+ : Attachments sent as part of the rich notification */ -@property(readonly)NSDictionary* attachments; +@property(readonly, nullable)NSDictionary* attachments; /* Action buttons passed */ -@property(readonly)NSArray *actionButtons; +@property(readonly, nullable)NSArray *actionButtons; /* Holds the original payload received Keep the raw value for users that would like to root the push */ -@property(readonly)NSDictionary *rawPayload; +@property(readonly, nonnull)NSDictionary *rawPayload; /* iOS 10+ : Groups notifications into threads */ -@property(readonly)NSString *threadId; +@property(readonly, nullable)NSString *threadId; -/* Parses an APS push payload into a OSNotificationPayload object. +/* Parses an APNS push payload into a OSNotification object. Useful to call from your NotificationServiceExtension when the didReceiveNotificationRequest:withContentHandler: method fires. */ + (instancetype)parseWithApns:(nonnull NSDictionary*)message; -@end - -/* OneSignal OSNotification */ -@interface OSNotification : NSObject - -/* Notification Payload */ -@property(readonly)OSNotificationPayload* payload; - -/* Display method of the notification */ -@property(readonly)OSNotificationDisplayType displayType; - -/* Set to true when the user was able to see the notification and reacted to it - Set to false when app is in focus and in-app alerts are disabled, or the remote notification is silent. */ -@property(readonly, getter=wasShown)BOOL shown; - -/* Set to true if the app was in focus when the notification */ -@property(readonly, getter=wasAppInFocus)BOOL isAppInFocus; - -/* Set to true when the received notification is silent - Silent means there is no alert, sound, or badge payload in the aps dictionary - requires remote-notification within UIBackgroundModes array of the Info.plist */ -@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. */ -@property(readonly, getter=hasMutableContent)BOOL mutableContent; +/* Convert object into a custom Dictionary / JSON Object */ +- (NSDictionary* _Nonnull)jsonRepresentation; /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ -- (NSString*)stringify; +- (NSString* _Nonnull)stringify; @end @interface OSNotificationOpenedResult : NSObject -@property(readonly)OSNotification* notification; -@property(readonly)OSNotificationAction *action; +@property(readonly, nonnull)OSNotification* notification; +@property(readonly, nonnull)OSNotificationAction *action; /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ -- (NSString*)stringify; +- (NSString* _Nonnull)stringify; + +// Convert the class into a NSDictionary +- (NSDictionary *_Nonnull)jsonRepresentation; @end; @@ -240,8 +207,10 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { - (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:)); @end +// Pass in nil means a notification will not display +typedef void (^OSNotificationDisplayResponse)(OSNotification* _Nullable notification); /* OneSignal Influence Types */ -typedef NS_ENUM(NSUInteger, Session) { +typedef NS_ENUM(NSUInteger, OSSession) { DIRECT, INDIRECT, UNATTRIBUTED, @@ -256,7 +225,7 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @interface OSOutcomeEvent : NSObject // Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params -@property (nonatomic) Session session; +@property (nonatomic) OSSession session; // Notification ids for the current session @property (strong, nonatomic, nullable) NSArray *notificationIds; @@ -275,7 +244,6 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @end - typedef NS_ENUM(NSInteger, OSNotificationPermission) { // The user has not yet made a choice regarding whether your app can show notifications. OSNotificationPermissionNotDetermined = 0, @@ -287,7 +255,10 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionAuthorized, // the application is only authorized to post Provisional notifications (direct to history) - OSNotificationPermissionProvisional + OSNotificationPermissionProvisional, + + // the application is authorized to send notifications for 8 hours. Only used by App Clips. + OSNotificationPermissionEphemeral }; // Permission Classes @@ -297,115 +268,119 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly, nonatomic) BOOL hasPrompted; @property (readonly, nonatomic) BOOL providesAppNotificationSettings; @property (readonly, nonatomic) OSNotificationPermission status; -- (NSDictionary*)toDictionary; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSPermissionStateChanges : NSObject -@property (readonly) OSPermissionState* to; -@property (readonly) OSPermissionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSPermissionState* to; +@property (readonly, nonnull) OSPermissionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges*)stateChanges; +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; @end - // Subscription Classes @interface OSSubscriptionState : NSObject -@property (readonly, nonatomic) BOOL subscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) -@property (readonly, nonatomic) BOOL userSubscriptionSetting; // returns setSubscription state. -@property (readonly, nonatomic) NSString* userId; // AKA OneSignal PlayerId -@property (readonly, nonatomic) NSString* pushToken; // AKA Apple Device Token -- (NSDictionary*)toDictionary; +@property (readonly, nonatomic) BOOL isSubscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) +@property (readonly, nonatomic) BOOL isPushDisabled; // returns value of disablePush. +@property (readonly, nonatomic, nullable) NSString* userId; // AKA OneSignal PlayerId +@property (readonly, nonatomic, nullable) NSString* pushToken; // AKA Apple Device Token +- (NSDictionary* _Nonnull)toDictionary; @end - @interface OSEmailSubscriptionState : NSObject -@property (readonly, nonatomic) NSString* emailUserId; // The new Email user ID -@property (readonly, nonatomic) NSString *emailAddress; -@property (readonly, nonatomic) BOOL subscribed; -- (NSDictionary*)toDictionary; +@property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID +@property (readonly, nonatomic, nullable) NSString *emailAddress; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSSubscriptionStateChanges : NSObject -@property (readonly) OSSubscriptionState* to; -@property (readonly) OSSubscriptionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSSubscriptionState* to; +@property (readonly, nonnull) OSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSEmailSubscriptionStateChanges : NSObject -@property (readonly) OSEmailSubscriptionState* to; -@property (readonly) OSEmailSubscriptionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSEmailSubscriptionState* to; +@property (readonly, nonnull) OSEmailSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @protocol OSSubscriptionObserver -- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges*)stateChanges; +- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @protocol OSEmailSubscriptionObserver -- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges*)stateChanges; +- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end - - // Permission+Subscription Classes @interface OSPermissionSubscriptionState : NSObject -@property (readonly) OSPermissionState* permissionStatus; -@property (readonly) OSSubscriptionState* subscriptionStatus; -@property (readonly) OSEmailSubscriptionState *emailSubscriptionStatus; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSPermissionState* permissionStatus; +@property (readonly, nonnull) OSSubscriptionState* subscriptionStatus; +@property (readonly, nonnull) OSEmailSubscriptionState *emailSubscriptionStatus; +- (NSDictionary* _Nonnull)toDictionary; @end -@interface OSDevice : NSObject +@interface OSDeviceState : NSObject /** * Get the app's notification permission * @return false if the user disabled notifications for the app, otherwise true */ -- (BOOL)isNotificationEnabled; +@property (readonly) BOOL hasNotificationPermission; /** * Get whether the user is subscribed to OneSignal notifications or not * @return false if the user is not subscribed to OneSignal notifications, otherwise true */ -- (BOOL)isUserSubscribed; +@property (readonly) BOOL isPushDisabled; /** * Get whether the user is subscribed * @return true if isNotificationEnabled, isUserSubscribed, getUserId and getPushToken are true, otherwise false */ -- (BOOL)isSubscribed; +@property (readonly) BOOL isSubscribed; /** * Get the user notification permision status * @return OSNotificationPermission */ -- (OSNotificationPermission)getNotificationPermissionStatus; +@property (readonly) OSNotificationPermission notificationPermissionStatus; /** * Get user id from registration (player id) - * @return user id if user is registered, otherwise false + * @return user id if user is registered, otherwise null */ -- (NSString*)getUserId; +@property (readonly, nullable) NSString* userId; /** * Get apple deice push token * @return push token if available, otherwise null */ -- (NSString*)getPushToken; +@property (readonly, nullable) NSString* pushToken; /** * Get the user email id * @return email id if user address was registered, otherwise null */ -- (NSString*)getEmailUserId; +@property (readonly, nullable) NSString* emailUserId; /** * Get the user email * @return email address if set, otherwise null */ -- (NSString*)getEmailAddress; +@property (readonly, nullable) NSString* emailAddress; + +@property (readonly) BOOL isEmailSubscribed; + +- (instancetype)initWithSubscriptionState:(OSPermissionSubscriptionState *)state; + +// Convert the class into a NSDictionary +- (NSDictionary *_Nonnull)jsonRepresentation; + @end typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen); @@ -414,157 +389,131 @@ typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen); typedef void (^OSResultSuccessBlock)(NSDictionary* result); typedef void (^OSFailureBlock)(NSError* error); -/*Block for notifying availability of the User's ID and push token*/ -typedef void (^OSIdsAvailableBlock)(NSString* userId, NSString* pushToken); - -/*Block for handling the reception of a remote notification */ -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); - /*Block for handling outcome event being sent successfully*/ typedef void (^OSSendOutcomeSuccess)(OSOutcomeEvent* outcome); /*Dictionary of keys to pass alongside the init settings*/ - -/*Let OneSignal directly prompt for push notifications on init*/ -extern NSString * const kOSSettingsKeyAutoPrompt; - -/*Enable the default in-app alerts*/ -extern NSString * const kOSSettingsKeyInAppAlerts; /*Enable In-App display of Launch URLs*/ extern NSString * const kOSSettingsKeyInAppLaunchURL; -/*Prompt user yes/no to open URL's from push notifications*/ -extern NSString * const kOSSSettingsKeyPromptBeforeOpeningPushURL; - -/* iOS 10 + - Set notification's in-focus display option. - Value must be an OSNotificationDisplayType enum -*/ -extern NSString * const kOSSettingsKeyInFocusDisplayOption; - - /* iOS 12 + Used to determine if the app is able to present it's own customized Notification Settings view */ extern NSString * const kOSSettingsKeyProvidesAppNotificationSettings; + + // ======= OneSignal Class Interface ========= @interface OneSignal : NSObject extern NSString* const ONESIGNAL_VERSION; -typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { - ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE -}; - ++ (NSString*)appId; ++ (NSString* _Nonnull)sdkVersionRaw; ++ (NSString* _Nonnull)sdkSemanticVersion; -/* - Initialize OneSignal. - Sends push token to OneSignal so you can later send notifications. - */ ++ (void)disablePush:(BOOL)disable; -// - Initialization -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback settings:(NSDictionary*)settings; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationReceived:(OSHandleNotificationReceivedBlock)receivedCallback handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback settings:(NSDictionary*)settings; ++ (NSString* _Nonnull)parseNSErrorAsJsonString:(NSError* _Nonnull)error; -// - Privacy -+ (void)consentGranted:(BOOL)granted; -+ (BOOL)requiresUserPrivacyConsent; // tells your application if privacy consent is still needed from the current user -+ (void)setRequiresUserPrivacyConsent:(BOOL)required; //used by wrapper SDK's to require user privacy consent +// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. ++ (void)setMSDKType:(NSString* _Nonnull)type; -@property (class) OSNotificationDisplayType inFocusDisplayType; +#pragma mark Initialization ++ (void)setAppId:(NSString* _Nonnull)newAppId; ++ (void)initWithLaunchOptions:(NSDictionary* _Nullable)launchOptions; +// TODO: Remove before releasing major release 3.0.0 ++ (void)setAppSettings:(NSDictionary* _Nonnull)settings; -+ (NSString*)app_id; -+ (NSString*)sdk_version_raw; -+ (NSString*)sdk_semantic_version; +#pragma mark Logging +typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + ONE_S_LL_NONE, + ONE_S_LL_FATAL, + ONE_S_LL_ERROR, + ONE_S_LL_WARN, + ONE_S_LL_INFO, + ONE_S_LL_DEBUG, + ONE_S_LL_VERBOSE +}; -// Only use if you set kOSSettingsKeyAutoPrompt to false -+ (void)registerForPushNotifications __deprecated_msg("Please use promptForPushNotificationsWithUserResponse instead."); -+ (void)promptForPushNotificationsWithUserResponse:(void(^)(BOOL accepted))completionHandler; -+ (void)promptForPushNotificationsWithUserResponse:(void (^)(BOOL accepted))completionHandler fallbackToSettings:(BOOL)fallback; ++ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel; ++ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString* _Nonnull)message; -// This method opens the iOS Settings app and navigates to the Push Notification Settings -// page for your app specifically -+ (void)presentAppSettings; -+ (void)registerForProvisionalAuthorization:(void(^)(BOOL accepted))completionHandler; +#pragma mark Prompt For Push +typedef void(^OSUserResponseBlock)(BOOL accepted); -// - Logging -+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel; -+ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString*)message; - -// - Tagging -+ (void)sendTag:(NSString*)key value:(NSString*)value onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)sendTag:(NSString*)key value:(NSString*)value; -+ (void)sendTags:(NSDictionary*)keyValuePair onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)sendTags:(NSDictionary*)keyValuePair; -+ (void)sendTagsWithJsonString:(NSString*)jsonString; -+ (void)getTags:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)getTags:(OSResultSuccessBlock)successBlock; -+ (void)deleteTag:(NSString*)key onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)deleteTag:(NSString*)key; -+ (void)deleteTags:(NSArray*)keys onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)deleteTags:(NSArray*)keys; -+ (void)deleteTagsWithJsonString:(NSString*)jsonString; -// Optional method that sends us the user's email as an anonymized hash so that we can better target and personalize notifications sent to that user across their devices. -// Sends as MD5 and SHA1 of the provided email -+ (void)syncHashedEmail:(NSString*)email __deprecated_msg("Please refer to our new Email methods/functionality such as setEmail(). This method will be removed in a future version of the OneSignal SDK"); - -// - Subscription and Permissions -+ (void)IdsAvailable:(OSIdsAvailableBlock)idsAvailableBlock __deprecated_msg("Please use getPermissionSubscriptionState or addSubscriptionObserver and addPermissionObserver instead."); - -+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState; -+ (OSDevice*)getUserDevice; ++ (void)promptForPushNotificationsWithUserResponse:(OSUserResponseBlock)block; ++ (void)promptForPushNotificationsWithUserResponse:(OSUserResponseBlock)block fallbackToSettings:(BOOL)fallback; ++ (void)registerForProvisionalAuthorization:(OSUserResponseBlock)block; ++ (OSDeviceState*)getDeviceState; -+ (void)addPermissionObserver:(NSObject*)observer; -+ (void)removePermissionObserver:(NSObject*)observer; +#pragma mark Privacy Consent ++ (void)consentGranted:(BOOL)granted; +// Tells your application if privacy consent is still needed from the current user ++ (BOOL)requiresUserPrivacyConsent; ++ (void)setRequiresUserPrivacyConsent:(BOOL)required; -+ (void)addSubscriptionObserver:(NSObject*)observer; -+ (void)removeSubscriptionObserver:(NSObject*)observer; +#pragma mark Public Handlers -+ (void)addEmailSubscriptionObserver:(NSObject*)observer; -+ (void)removeEmailSubscriptionObserver:(NSObject*)observer; +// If the completion block is not called within 25 seconds of this block being called in notificationWillShowInForegroundHandler then the completion will be automatically fired. +typedef void (^OSNotificationWillShowInForegroundBlock)(OSNotification * _Nonnull notification, OSNotificationDisplayResponse _Nonnull completion); +typedef void (^OSNotificationOpenedBlock)(OSNotificationOpenedResult * _Nonnull result); +typedef void (^OSInAppMessageClickBlock)(OSInAppMessageAction * _Nonnull action); -+ (void)setSubscription:(BOOL)enable; -+ (BOOL)isInAppMessagingPaused; -+ (void)pauseInAppMessages:(BOOL)pause; ++ (void)setNotificationWillShowInForegroundHandler:(OSNotificationWillShowInForegroundBlock _Nullable)block; ++ (void)setNotificationOpenedHandler:(OSNotificationOpenedBlock _Nullable)block; ++ (void)setInAppMessageClickHandler:(OSInAppMessageClickBlock _Nullable)block; -// - Posting Notification -+ (void)postNotification:(NSDictionary*)jsonData; -+ (void)postNotification:(NSDictionary*)jsonData onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)postNotificationWithJsonString:(NSString*)jsonData onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (NSString*)parseNSErrorAsJsonString:(NSError*)error; +#pragma mark Post Notification ++ (void)postNotification:(NSDictionary* _Nonnull)jsonData; ++ (void)postNotification:(NSDictionary* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)postNotificationWithJsonString:(NSString* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; +#pragma mark Location // - Request and track user's location + (void)promptLocation; + (void)setLocationShared:(BOOL)enable; + (BOOL)isLocationShared; - -// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. -+ (void)setMSDKType:(NSString*)type; - -+ (void)setInAppMessageClickHandler:(OSHandleInAppMessageActionClickBlock)delegate; - +#pragma mark NotificationService Extension // iOS 10 only // Process from Notification Service Extension. // Used for iOS Media Attachemtns and Action Buttons. -+ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; -+ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; ++ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent; ++ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent; + +#pragma mark Tags ++ (void)sendTag:(NSString* _Nonnull)key value:(NSString* _Nonnull)value onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)sendTag:(NSString* _Nonnull)key value:(NSString* _Nonnull)value; ++ (void)sendTags:(NSDictionary* _Nonnull)keyValuePair onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)sendTags:(NSDictionary* _Nonnull)keyValuePair; ++ (void)sendTagsWithJsonString:(NSString* _Nonnull)jsonString; ++ (void)getTags:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)getTags:(OSResultSuccessBlock _Nullable)successBlock; ++ (void)deleteTag:(NSString* _Nonnull)key onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)deleteTag:(NSString* _Nonnull)key; ++ (void)deleteTags:(NSArray* _Nonnull)keys onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)deleteTags:(NSArray *_Nonnull)keys; ++ (void)deleteTagsWithJsonString:(NSString* _Nonnull)jsonString; + +#pragma mark Permission, Subscription, and Email Observers +NS_ASSUME_NONNULL_BEGIN + ++ (void)addPermissionObserver:(NSObject*)observer; ++ (void)removePermissionObserver:(NSObject*)observer; + ++ (void)addSubscriptionObserver:(NSObject*)observer; ++ (void)removeSubscriptionObserver:(NSObject*)observer; -// Email methods ++ (void)addEmailSubscriptionObserver:(NSObject*)observer; ++ (void)removeEmailSubscriptionObserver:(NSObject*)observer; +NS_ASSUME_NONNULL_END +#pragma mark Email // Typedefs defining completion blocks for email & simultaneous HTTP requests -typedef void (^OSEmailFailureBlock)(NSError* error); +typedef void (^OSEmailFailureBlock)(NSError *error); typedef void (^OSEmailSuccessBlock)(); // Allows you to set the email for this user. @@ -583,16 +532,17 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; -// External user id +#pragma mark External User Id // Typedefs defining completion blocks for updating the external user id typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results); - + (void)setExternalUserId:(NSString * _Nonnull)externalId; + (void)setExternalUserId:(NSString * _Nonnull)externalId withCompletion:(OSUpdateExternalUserIdBlock _Nullable)completionBlock; + (void)removeExternalUserId; + (void)removeExternalUserId:(OSUpdateExternalUserIdBlock _Nullable)completionBlock; -// In-App Messaging triggers +#pragma mark In-App Messaging ++ (BOOL)isInAppMessagingPaused; ++ (void)pauseInAppMessages:(BOOL)pause; + (void)addTrigger:(NSString * _Nonnull)key withValue:(id _Nonnull)value; + (void)addTriggers:(NSDictionary * _Nonnull)triggers; + (void)removeTriggerForKey:(NSString * _Nonnull)key; @@ -600,7 +550,7 @@ typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results); + (NSDictionary * _Nonnull)getTriggers; + (id _Nullable)getTriggerValueForKey:(NSString * _Nonnull)key; -// Outcome Events +#pragma mark Outcomes + (void)sendOutcome:(NSString * _Nonnull)name; + (void)sendOutcome:(NSString * _Nonnull)name onSuccess:(OSSendOutcomeSuccess _Nullable)success; + (void)sendUniqueOutcome:(NSString * _Nonnull)name; diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Info.plist b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Info.plist index 377d880bc..678d69168 100644 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Info.plist and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/Info.plist differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/OneSignal b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/OneSignal index 29570a823..605bd38c2 100755 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/OneSignal and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources index f6080c6d9..b529097e4 100644 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources @@ -6,11 +6,11 @@ Headers/OneSignal.h - Rjg2nGdfKl6z6JAAgX0hj3FyVts= + 3SpujH8w/KRM449Cv7G3f/9P/2A= Info.plist - sk2yyjDQKvDKYEX3DKSgqm8I9gM= + HNPPixQCA3c6Ku+bH1t5559akWY= Modules/module.modulemap @@ -23,11 +23,11 @@ hash - Rjg2nGdfKl6z6JAAgX0hj3FyVts= + 3SpujH8w/KRM449Cv7G3f/9P/2A= hash2 - fVbMqu1Q2Scy9T39UZiD9hcYWNv8+9K0u5CZIXuExrc= + F8Ivalakom7uu+aE8Pm2H90HqLkEvr9F3mzBpbhcObE= Modules/module.modulemap diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h index 8bed5da8a..2d8f00abb 100755 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h @@ -54,53 +54,41 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { OSNotificationActionTypeActionTaken }; -/* The way a notification was displayed to the user */ -typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { - /*Notification is silent, or app is in focus but InAppAlertNotifications are disabled*/ - OSNotificationDisplayTypeNone, - - /*Default UIAlertController display*/ - OSNotificationDisplayTypeInAppAlert, - - /*iOS native notification display*/ - OSNotificationDisplayTypeNotification -}; - @interface OSNotificationAction : NSObject /* The type of the notification action */ @property(readonly)OSNotificationActionType type; -/* The ID associated with the button tapped. NULL when the actionType is NotificationTapped or InAppAlertClosed */ -@property(readonly)NSString* actionID; +/* The ID associated with the button tapped. NULL when the actionType is NotificationTapped */ +@property(readonly, nullable)NSString* actionId; @end -/* Notification Payload Received Object */ -@interface OSNotificationPayload : NSObject +/* OneSignal OSNotification */ +@interface OSNotification : NSObject /* Unique Message Identifier */ -@property(readonly)NSString* notificationID; +@property(readonly, nullable)NSString* notificationId; /* Unique Template Identifier */ -@property(readonly)NSString* templateID; +@property(readonly, nullable)NSString* templateId; /* Name of Template */ -@property(readonly)NSString* templateName; +@property(readonly, nullable)NSString* templateName; -/* True when the key content-available is set to 1 in the aps payload. +/* True when the key content-available is set to 1 in the apns payload. content-available is used to wake your app when the payload is received. See Apple's documenation for more details. https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application */ @property(readonly)BOOL contentAvailable; -/* True when the key mutable-content is set to 1 in the aps payload. +/* True when the key mutable-content is set to 1 in the apns payload. mutable-content is used to wake your Notification Service Extension to modify a notification. See Apple's documenation for more details. https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension */ -@property(readonly)BOOL mutableContent; +@property(readonly, getter=hasMutableContent)BOOL mutableContent; /* Notification category key previously registered to display with. @@ -108,84 +96,63 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { See Apple's documenation for more details. https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW26 */ -@property(readonly)NSString* category; +@property(readonly, nullable)NSString* category; /* The badge assigned to the application icon */ -@property(readonly)NSUInteger badge; +@property(readonly)NSInteger badge; @property(readonly)NSInteger badgeIncrement; /* The sound parameter passed to the notification By default set to UILocalNotificationDefaultSoundName */ -@property(readonly)NSString* sound; +@property(readonly, nullable)NSString* sound; /* Main push content */ -@property(readonly)NSString* title; -@property(readonly)NSString* subtitle; -@property(readonly)NSString* body; +@property(readonly, nullable)NSString* title; +@property(readonly, nullable)NSString* subtitle; +@property(readonly, nullable)NSString* body; /* Web address to launch within the app via a WKWebView */ -@property(readonly)NSString* launchURL; +@property(readonly, nullable)NSString* launchURL; /* Additional key value properties set within the payload */ -@property(readonly)NSDictionary* additionalData; +@property(readonly, nullable)NSDictionary* additionalData; /* iOS 10+ : Attachments sent as part of the rich notification */ -@property(readonly)NSDictionary* attachments; +@property(readonly, nullable)NSDictionary* attachments; /* Action buttons passed */ -@property(readonly)NSArray *actionButtons; +@property(readonly, nullable)NSArray *actionButtons; /* Holds the original payload received Keep the raw value for users that would like to root the push */ -@property(readonly)NSDictionary *rawPayload; +@property(readonly, nonnull)NSDictionary *rawPayload; /* iOS 10+ : Groups notifications into threads */ -@property(readonly)NSString *threadId; +@property(readonly, nullable)NSString *threadId; -/* Parses an APS push payload into a OSNotificationPayload object. +/* Parses an APNS push payload into a OSNotification object. Useful to call from your NotificationServiceExtension when the didReceiveNotificationRequest:withContentHandler: method fires. */ + (instancetype)parseWithApns:(nonnull NSDictionary*)message; -@end - -/* OneSignal OSNotification */ -@interface OSNotification : NSObject - -/* Notification Payload */ -@property(readonly)OSNotificationPayload* payload; - -/* Display method of the notification */ -@property(readonly)OSNotificationDisplayType displayType; - -/* Set to true when the user was able to see the notification and reacted to it - Set to false when app is in focus and in-app alerts are disabled, or the remote notification is silent. */ -@property(readonly, getter=wasShown)BOOL shown; - -/* Set to true if the app was in focus when the notification */ -@property(readonly, getter=wasAppInFocus)BOOL isAppInFocus; - -/* Set to true when the received notification is silent - Silent means there is no alert, sound, or badge payload in the aps dictionary - requires remote-notification within UIBackgroundModes array of the Info.plist */ -@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. */ -@property(readonly, getter=hasMutableContent)BOOL mutableContent; +/* Convert object into a custom Dictionary / JSON Object */ +- (NSDictionary* _Nonnull)jsonRepresentation; /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ -- (NSString*)stringify; +- (NSString* _Nonnull)stringify; @end @interface OSNotificationOpenedResult : NSObject -@property(readonly)OSNotification* notification; -@property(readonly)OSNotificationAction *action; +@property(readonly, nonnull)OSNotification* notification; +@property(readonly, nonnull)OSNotificationAction *action; /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ -- (NSString*)stringify; +- (NSString* _Nonnull)stringify; + +// Convert the class into a NSDictionary +- (NSDictionary *_Nonnull)jsonRepresentation; @end; @@ -240,8 +207,10 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) { - (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:)); @end +// Pass in nil means a notification will not display +typedef void (^OSNotificationDisplayResponse)(OSNotification* _Nullable notification); /* OneSignal Influence Types */ -typedef NS_ENUM(NSUInteger, Session) { +typedef NS_ENUM(NSUInteger, OSSession) { DIRECT, INDIRECT, UNATTRIBUTED, @@ -256,7 +225,7 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @interface OSOutcomeEvent : NSObject // Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params -@property (nonatomic) Session session; +@property (nonatomic) OSSession session; // Notification ids for the current session @property (strong, nonatomic, nullable) NSArray *notificationIds; @@ -275,7 +244,6 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @end - typedef NS_ENUM(NSInteger, OSNotificationPermission) { // The user has not yet made a choice regarding whether your app can show notifications. OSNotificationPermissionNotDetermined = 0, @@ -287,7 +255,10 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionAuthorized, // the application is only authorized to post Provisional notifications (direct to history) - OSNotificationPermissionProvisional + OSNotificationPermissionProvisional, + + // the application is authorized to send notifications for 8 hours. Only used by App Clips. + OSNotificationPermissionEphemeral }; // Permission Classes @@ -297,115 +268,119 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly, nonatomic) BOOL hasPrompted; @property (readonly, nonatomic) BOOL providesAppNotificationSettings; @property (readonly, nonatomic) OSNotificationPermission status; -- (NSDictionary*)toDictionary; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSPermissionStateChanges : NSObject -@property (readonly) OSPermissionState* to; -@property (readonly) OSPermissionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSPermissionState* to; +@property (readonly, nonnull) OSPermissionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges*)stateChanges; +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; @end - // Subscription Classes @interface OSSubscriptionState : NSObject -@property (readonly, nonatomic) BOOL subscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) -@property (readonly, nonatomic) BOOL userSubscriptionSetting; // returns setSubscription state. -@property (readonly, nonatomic) NSString* userId; // AKA OneSignal PlayerId -@property (readonly, nonatomic) NSString* pushToken; // AKA Apple Device Token -- (NSDictionary*)toDictionary; +@property (readonly, nonatomic) BOOL isSubscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) +@property (readonly, nonatomic) BOOL isPushDisabled; // returns value of disablePush. +@property (readonly, nonatomic, nullable) NSString* userId; // AKA OneSignal PlayerId +@property (readonly, nonatomic, nullable) NSString* pushToken; // AKA Apple Device Token +- (NSDictionary* _Nonnull)toDictionary; @end - @interface OSEmailSubscriptionState : NSObject -@property (readonly, nonatomic) NSString* emailUserId; // The new Email user ID -@property (readonly, nonatomic) NSString *emailAddress; -@property (readonly, nonatomic) BOOL subscribed; -- (NSDictionary*)toDictionary; +@property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID +@property (readonly, nonatomic, nullable) NSString *emailAddress; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSSubscriptionStateChanges : NSObject -@property (readonly) OSSubscriptionState* to; -@property (readonly) OSSubscriptionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSSubscriptionState* to; +@property (readonly, nonnull) OSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @interface OSEmailSubscriptionStateChanges : NSObject -@property (readonly) OSEmailSubscriptionState* to; -@property (readonly) OSEmailSubscriptionState* from; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSEmailSubscriptionState* to; +@property (readonly, nonnull) OSEmailSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; @end @protocol OSSubscriptionObserver -- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges*)stateChanges; +- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @protocol OSEmailSubscriptionObserver -- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges*)stateChanges; +- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end - - // Permission+Subscription Classes @interface OSPermissionSubscriptionState : NSObject -@property (readonly) OSPermissionState* permissionStatus; -@property (readonly) OSSubscriptionState* subscriptionStatus; -@property (readonly) OSEmailSubscriptionState *emailSubscriptionStatus; -- (NSDictionary*)toDictionary; +@property (readonly, nonnull) OSPermissionState* permissionStatus; +@property (readonly, nonnull) OSSubscriptionState* subscriptionStatus; +@property (readonly, nonnull) OSEmailSubscriptionState *emailSubscriptionStatus; +- (NSDictionary* _Nonnull)toDictionary; @end -@interface OSDevice : NSObject +@interface OSDeviceState : NSObject /** * Get the app's notification permission * @return false if the user disabled notifications for the app, otherwise true */ -- (BOOL)isNotificationEnabled; +@property (readonly) BOOL hasNotificationPermission; /** * Get whether the user is subscribed to OneSignal notifications or not * @return false if the user is not subscribed to OneSignal notifications, otherwise true */ -- (BOOL)isUserSubscribed; +@property (readonly) BOOL isPushDisabled; /** * Get whether the user is subscribed * @return true if isNotificationEnabled, isUserSubscribed, getUserId and getPushToken are true, otherwise false */ -- (BOOL)isSubscribed; +@property (readonly) BOOL isSubscribed; /** * Get the user notification permision status * @return OSNotificationPermission */ -- (OSNotificationPermission)getNotificationPermissionStatus; +@property (readonly) OSNotificationPermission notificationPermissionStatus; /** * Get user id from registration (player id) - * @return user id if user is registered, otherwise false + * @return user id if user is registered, otherwise null */ -- (NSString*)getUserId; +@property (readonly, nullable) NSString* userId; /** * Get apple deice push token * @return push token if available, otherwise null */ -- (NSString*)getPushToken; +@property (readonly, nullable) NSString* pushToken; /** * Get the user email id * @return email id if user address was registered, otherwise null */ -- (NSString*)getEmailUserId; +@property (readonly, nullable) NSString* emailUserId; /** * Get the user email * @return email address if set, otherwise null */ -- (NSString*)getEmailAddress; +@property (readonly, nullable) NSString* emailAddress; + +@property (readonly) BOOL isEmailSubscribed; + +- (instancetype)initWithSubscriptionState:(OSPermissionSubscriptionState *)state; + +// Convert the class into a NSDictionary +- (NSDictionary *_Nonnull)jsonRepresentation; + @end typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen); @@ -414,157 +389,131 @@ typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen); typedef void (^OSResultSuccessBlock)(NSDictionary* result); typedef void (^OSFailureBlock)(NSError* error); -/*Block for notifying availability of the User's ID and push token*/ -typedef void (^OSIdsAvailableBlock)(NSString* userId, NSString* pushToken); - -/*Block for handling the reception of a remote notification */ -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); - /*Block for handling outcome event being sent successfully*/ typedef void (^OSSendOutcomeSuccess)(OSOutcomeEvent* outcome); /*Dictionary of keys to pass alongside the init settings*/ - -/*Let OneSignal directly prompt for push notifications on init*/ -extern NSString * const kOSSettingsKeyAutoPrompt; - -/*Enable the default in-app alerts*/ -extern NSString * const kOSSettingsKeyInAppAlerts; /*Enable In-App display of Launch URLs*/ extern NSString * const kOSSettingsKeyInAppLaunchURL; -/*Prompt user yes/no to open URL's from push notifications*/ -extern NSString * const kOSSSettingsKeyPromptBeforeOpeningPushURL; - -/* iOS 10 + - Set notification's in-focus display option. - Value must be an OSNotificationDisplayType enum -*/ -extern NSString * const kOSSettingsKeyInFocusDisplayOption; - - /* iOS 12 + Used to determine if the app is able to present it's own customized Notification Settings view */ extern NSString * const kOSSettingsKeyProvidesAppNotificationSettings; + + // ======= OneSignal Class Interface ========= @interface OneSignal : NSObject extern NSString* const ONESIGNAL_VERSION; -typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { - ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE -}; - ++ (NSString*)appId; ++ (NSString* _Nonnull)sdkVersionRaw; ++ (NSString* _Nonnull)sdkSemanticVersion; -/* - Initialize OneSignal. - Sends push token to OneSignal so you can later send notifications. - */ ++ (void)disablePush:(BOOL)disable; -// - Initialization -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback settings:(NSDictionary*)settings; -+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotificationReceived:(OSHandleNotificationReceivedBlock)receivedCallback handleNotificationAction:(OSHandleNotificationActionBlock)actionCallback settings:(NSDictionary*)settings; ++ (NSString* _Nonnull)parseNSErrorAsJsonString:(NSError* _Nonnull)error; -// - Privacy -+ (void)consentGranted:(BOOL)granted; -+ (BOOL)requiresUserPrivacyConsent; // tells your application if privacy consent is still needed from the current user -+ (void)setRequiresUserPrivacyConsent:(BOOL)required; //used by wrapper SDK's to require user privacy consent +// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. ++ (void)setMSDKType:(NSString* _Nonnull)type; -@property (class) OSNotificationDisplayType inFocusDisplayType; +#pragma mark Initialization ++ (void)setAppId:(NSString* _Nonnull)newAppId; ++ (void)initWithLaunchOptions:(NSDictionary* _Nullable)launchOptions; +// TODO: Remove before releasing major release 3.0.0 ++ (void)setAppSettings:(NSDictionary* _Nonnull)settings; -+ (NSString*)app_id; -+ (NSString*)sdk_version_raw; -+ (NSString*)sdk_semantic_version; +#pragma mark Logging +typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { + ONE_S_LL_NONE, + ONE_S_LL_FATAL, + ONE_S_LL_ERROR, + ONE_S_LL_WARN, + ONE_S_LL_INFO, + ONE_S_LL_DEBUG, + ONE_S_LL_VERBOSE +}; -// Only use if you set kOSSettingsKeyAutoPrompt to false -+ (void)registerForPushNotifications __deprecated_msg("Please use promptForPushNotificationsWithUserResponse instead."); -+ (void)promptForPushNotificationsWithUserResponse:(void(^)(BOOL accepted))completionHandler; -+ (void)promptForPushNotificationsWithUserResponse:(void (^)(BOOL accepted))completionHandler fallbackToSettings:(BOOL)fallback; ++ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel; ++ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString* _Nonnull)message; -// This method opens the iOS Settings app and navigates to the Push Notification Settings -// page for your app specifically -+ (void)presentAppSettings; -+ (void)registerForProvisionalAuthorization:(void(^)(BOOL accepted))completionHandler; +#pragma mark Prompt For Push +typedef void(^OSUserResponseBlock)(BOOL accepted); -// - Logging -+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel; -+ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString*)message; - -// - Tagging -+ (void)sendTag:(NSString*)key value:(NSString*)value onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)sendTag:(NSString*)key value:(NSString*)value; -+ (void)sendTags:(NSDictionary*)keyValuePair onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)sendTags:(NSDictionary*)keyValuePair; -+ (void)sendTagsWithJsonString:(NSString*)jsonString; -+ (void)getTags:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)getTags:(OSResultSuccessBlock)successBlock; -+ (void)deleteTag:(NSString*)key onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)deleteTag:(NSString*)key; -+ (void)deleteTags:(NSArray*)keys onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)deleteTags:(NSArray*)keys; -+ (void)deleteTagsWithJsonString:(NSString*)jsonString; -// Optional method that sends us the user's email as an anonymized hash so that we can better target and personalize notifications sent to that user across their devices. -// Sends as MD5 and SHA1 of the provided email -+ (void)syncHashedEmail:(NSString*)email __deprecated_msg("Please refer to our new Email methods/functionality such as setEmail(). This method will be removed in a future version of the OneSignal SDK"); - -// - Subscription and Permissions -+ (void)IdsAvailable:(OSIdsAvailableBlock)idsAvailableBlock __deprecated_msg("Please use getPermissionSubscriptionState or addSubscriptionObserver and addPermissionObserver instead."); - -+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState; -+ (OSDevice*)getUserDevice; ++ (void)promptForPushNotificationsWithUserResponse:(OSUserResponseBlock)block; ++ (void)promptForPushNotificationsWithUserResponse:(OSUserResponseBlock)block fallbackToSettings:(BOOL)fallback; ++ (void)registerForProvisionalAuthorization:(OSUserResponseBlock)block; ++ (OSDeviceState*)getDeviceState; -+ (void)addPermissionObserver:(NSObject*)observer; -+ (void)removePermissionObserver:(NSObject*)observer; +#pragma mark Privacy Consent ++ (void)consentGranted:(BOOL)granted; +// Tells your application if privacy consent is still needed from the current user ++ (BOOL)requiresUserPrivacyConsent; ++ (void)setRequiresUserPrivacyConsent:(BOOL)required; -+ (void)addSubscriptionObserver:(NSObject*)observer; -+ (void)removeSubscriptionObserver:(NSObject*)observer; +#pragma mark Public Handlers -+ (void)addEmailSubscriptionObserver:(NSObject*)observer; -+ (void)removeEmailSubscriptionObserver:(NSObject*)observer; +// If the completion block is not called within 25 seconds of this block being called in notificationWillShowInForegroundHandler then the completion will be automatically fired. +typedef void (^OSNotificationWillShowInForegroundBlock)(OSNotification * _Nonnull notification, OSNotificationDisplayResponse _Nonnull completion); +typedef void (^OSNotificationOpenedBlock)(OSNotificationOpenedResult * _Nonnull result); +typedef void (^OSInAppMessageClickBlock)(OSInAppMessageAction * _Nonnull action); -+ (void)setSubscription:(BOOL)enable; -+ (BOOL)isInAppMessagingPaused; -+ (void)pauseInAppMessages:(BOOL)pause; ++ (void)setNotificationWillShowInForegroundHandler:(OSNotificationWillShowInForegroundBlock _Nullable)block; ++ (void)setNotificationOpenedHandler:(OSNotificationOpenedBlock _Nullable)block; ++ (void)setInAppMessageClickHandler:(OSInAppMessageClickBlock _Nullable)block; -// - Posting Notification -+ (void)postNotification:(NSDictionary*)jsonData; -+ (void)postNotification:(NSDictionary*)jsonData onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (void)postNotificationWithJsonString:(NSString*)jsonData onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock; -+ (NSString*)parseNSErrorAsJsonString:(NSError*)error; +#pragma mark Post Notification ++ (void)postNotification:(NSDictionary* _Nonnull)jsonData; ++ (void)postNotification:(NSDictionary* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)postNotificationWithJsonString:(NSString* _Nonnull)jsonData onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; +#pragma mark Location // - Request and track user's location + (void)promptLocation; + (void)setLocationShared:(BOOL)enable; + (BOOL)isLocationShared; - -// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc. -+ (void)setMSDKType:(NSString*)type; - -+ (void)setInAppMessageClickHandler:(OSHandleInAppMessageActionClickBlock)delegate; - +#pragma mark NotificationService Extension // iOS 10 only // Process from Notification Service Extension. // Used for iOS Media Attachemtns and Action Buttons. -+ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; -+ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest*)request withMutableNotificationContent:(UNMutableNotificationContent*)replacementContent; ++ (UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent; ++ (UNMutableNotificationContent*)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest* _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent* _Nullable)replacementContent; + +#pragma mark Tags ++ (void)sendTag:(NSString* _Nonnull)key value:(NSString* _Nonnull)value onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)sendTag:(NSString* _Nonnull)key value:(NSString* _Nonnull)value; ++ (void)sendTags:(NSDictionary* _Nonnull)keyValuePair onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)sendTags:(NSDictionary* _Nonnull)keyValuePair; ++ (void)sendTagsWithJsonString:(NSString* _Nonnull)jsonString; ++ (void)getTags:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)getTags:(OSResultSuccessBlock _Nullable)successBlock; ++ (void)deleteTag:(NSString* _Nonnull)key onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)deleteTag:(NSString* _Nonnull)key; ++ (void)deleteTags:(NSArray* _Nonnull)keys onSuccess:(OSResultSuccessBlock _Nullable)successBlock onFailure:(OSFailureBlock _Nullable)failureBlock; ++ (void)deleteTags:(NSArray *_Nonnull)keys; ++ (void)deleteTagsWithJsonString:(NSString* _Nonnull)jsonString; + +#pragma mark Permission, Subscription, and Email Observers +NS_ASSUME_NONNULL_BEGIN + ++ (void)addPermissionObserver:(NSObject*)observer; ++ (void)removePermissionObserver:(NSObject*)observer; + ++ (void)addSubscriptionObserver:(NSObject*)observer; ++ (void)removeSubscriptionObserver:(NSObject*)observer; -// Email methods ++ (void)addEmailSubscriptionObserver:(NSObject*)observer; ++ (void)removeEmailSubscriptionObserver:(NSObject*)observer; +NS_ASSUME_NONNULL_END +#pragma mark Email // Typedefs defining completion blocks for email & simultaneous HTTP requests -typedef void (^OSEmailFailureBlock)(NSError* error); +typedef void (^OSEmailFailureBlock)(NSError *error); typedef void (^OSEmailSuccessBlock)(); // Allows you to set the email for this user. @@ -583,16 +532,17 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; -// External user id +#pragma mark External User Id // Typedefs defining completion blocks for updating the external user id typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results); - + (void)setExternalUserId:(NSString * _Nonnull)externalId; + (void)setExternalUserId:(NSString * _Nonnull)externalId withCompletion:(OSUpdateExternalUserIdBlock _Nullable)completionBlock; + (void)removeExternalUserId; + (void)removeExternalUserId:(OSUpdateExternalUserIdBlock _Nullable)completionBlock; -// In-App Messaging triggers +#pragma mark In-App Messaging ++ (BOOL)isInAppMessagingPaused; ++ (void)pauseInAppMessages:(BOOL)pause; + (void)addTrigger:(NSString * _Nonnull)key withValue:(id _Nonnull)value; + (void)addTriggers:(NSDictionary * _Nonnull)triggers; + (void)removeTriggerForKey:(NSString * _Nonnull)key; @@ -600,7 +550,7 @@ typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary* results); + (NSDictionary * _Nonnull)getTriggers; + (id _Nullable)getTriggerValueForKey:(NSString * _Nonnull)key; -// Outcome Events +#pragma mark Outcomes + (void)sendOutcome:(NSString * _Nonnull)name; + (void)sendOutcome:(NSString * _Nonnull)name onSuccess:(OSSendOutcomeSuccess _Nullable)success; + (void)sendUniqueOutcome:(NSString * _Nonnull)name; diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal index a847e22f0..910f07035 100755 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Resources/Info.plist b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Resources/Info.plist index 711483324..fcdaffc4a 100644 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Resources/Info.plist +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-x86_64-maccatalyst/OneSignal.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 19F101 + 19H2 CFBundleDevelopmentRegion en CFBundleExecutable @@ -27,17 +27,17 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 11E708 + 11A420a DTPlatformVersion GM DTSDKBuild - 19G68 + 19A547 DTSDKName macosx10.15 DTXcode - 1160 + 1100 DTXcodeBuild - 11E708 + 11A420a LSMinimumSystemVersion 10.15 UIDeviceFamily diff --git a/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h b/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h index def4b6e1a..2d8f00abb 100755 --- a/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h @@ -135,6 +135,9 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { didReceiveNotificationRequest:withContentHandler: method fires. */ + (instancetype)parseWithApns:(nonnull NSDictionary*)message; +/* Convert object into a custom Dictionary / JSON Object */ +- (NSDictionary* _Nonnull)jsonRepresentation; + /* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */ - (NSString* _Nonnull)stringify; @@ -207,7 +210,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) { // Pass in nil means a notification will not display typedef void (^OSNotificationDisplayResponse)(OSNotification* _Nullable notification); /* OneSignal Influence Types */ -typedef NS_ENUM(NSUInteger, Session) { +typedef NS_ENUM(NSUInteger, OSSession) { DIRECT, INDIRECT, UNATTRIBUTED, @@ -222,7 +225,7 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) { @interface OSOutcomeEvent : NSObject // Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params -@property (nonatomic) Session session; +@property (nonatomic) OSSession session; // Notification ids for the current session @property (strong, nonatomic, nullable) NSArray *notificationIds; @@ -252,7 +255,10 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { OSNotificationPermissionAuthorized, // the application is only authorized to post Provisional notifications (direct to history) - OSNotificationPermissionProvisional + OSNotificationPermissionProvisional, + + // the application is authorized to send notifications for 8 hours. Only used by App Clips. + OSNotificationPermissionEphemeral }; // Permission Classes @@ -281,8 +287,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { // Subscription Classes @interface OSSubscriptionState : NSObject -@property (readonly, nonatomic) BOOL subscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) -@property (readonly, nonatomic) BOOL userSubscriptionSetting; // returns setSubscription state. +@property (readonly, nonatomic) BOOL isSubscribed; // (yes only if userId, pushToken, and setSubscription exists / are true) +@property (readonly, nonatomic) BOOL isPushDisabled; // returns value of disablePush. @property (readonly, nonatomic, nullable) NSString* userId; // AKA OneSignal PlayerId @property (readonly, nonatomic, nullable) NSString* pushToken; // AKA Apple Device Token - (NSDictionary* _Nonnull)toDictionary; @@ -292,7 +298,7 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @interface OSEmailSubscriptionState : NSObject @property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID @property (readonly, nonatomic, nullable) NSString *emailAddress; -@property (readonly, nonatomic) BOOL subscribed; +@property (readonly, nonatomic) BOOL isSubscribed; - (NSDictionary* _Nonnull)toDictionary; @end @@ -368,6 +374,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { */ @property (readonly, nullable) NSString* emailAddress; +@property (readonly) BOOL isEmailSubscribed; + - (instancetype)initWithSubscriptionState:(OSPermissionSubscriptionState *)state; // Convert the class into a NSDictionary @@ -492,7 +500,6 @@ typedef void (^OSInAppMessageClickBlock)(OSInAppMessageAction * _Nonnull action) #pragma mark Permission, Subscription, and Email Observers NS_ASSUME_NONNULL_BEGIN -+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState; + (void)addPermissionObserver:(NSObject*)observer; + (void)removePermissionObserver:(NSObject*)observer;