@@ -135,6 +135,9 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) {
135135 didReceiveNotificationRequest:withContentHandler: method fires. */
136136+ (instancetype )parseWithApns : (nonnull NSDictionary *)message ;
137137
138+ /* Convert object into a custom Dictionary / JSON Object */
139+ - (NSDictionary * _Nonnull)jsonRepresentation ;
140+
138141/* Convert object into an NSString that can be convertible into a custom Dictionary / JSON Object */
139142- (NSString * _Nonnull)stringify ;
140143
@@ -207,7 +210,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationActionType) {
207210// Pass in nil means a notification will not display
208211typedef void (^OSNotificationDisplayResponse)(OSNotification* _Nullable notification);
209212/* OneSignal Influence Types */
210- typedef NS_ENUM (NSUInteger , Session ) {
213+ typedef NS_ENUM (NSUInteger , OSInfluenceType ) {
211214 DIRECT,
212215 INDIRECT,
213216 UNATTRIBUTED,
@@ -222,7 +225,7 @@ typedef NS_ENUM(NSUInteger, OSInfluenceChannel) {
222225@interface OSOutcomeEvent : NSObject
223226
224227// Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params
225- @property (nonatomic ) Session session;
228+ @property (nonatomic ) OSInfluenceType session;
226229
227230// Notification ids for the current session
228231@property (strong , nonatomic , nullable ) NSArray *notificationIds;
@@ -252,7 +255,10 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
252255 OSNotificationPermissionAuthorized,
253256
254257 // the application is only authorized to post Provisional notifications (direct to history)
255- OSNotificationPermissionProvisional
258+ OSNotificationPermissionProvisional,
259+
260+ // the application is authorized to send notifications for 8 hours. Only used by App Clips.
261+ OSNotificationPermissionEphemeral
256262};
257263
258264// Permission Classes
@@ -274,15 +280,11 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
274280
275281@end
276282
277- @protocol OSPermissionObserver <NSObject >
278- - (void )onOSPermissionChanged : (OSPermissionStateChanges* _Nonnull)stateChanges ;
279- @end
280-
281283// Subscription Classes
282284@interface OSSubscriptionState : NSObject
283285
284- @property (readonly , nonatomic ) BOOL subscribed ; // (yes only if userId, pushToken, and setSubscription exists / are true)
285- @property (readonly , nonatomic ) BOOL userSubscriptionSetting ; // returns setSubscription state .
286+ @property (readonly , nonatomic ) BOOL isSubscribed ; // (yes only if userId, pushToken, and setSubscription exists / are true)
287+ @property (readonly , nonatomic ) BOOL isPushDisabled ; // returns value of disablePush .
286288@property (readonly , nonatomic , nullable ) NSString * userId; // AKA OneSignal PlayerId
287289@property (readonly , nonatomic , nullable ) NSString * pushToken; // AKA Apple Device Token
288290- (NSDictionary * _Nonnull)toDictionary ;
@@ -292,7 +294,7 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
292294@interface OSEmailSubscriptionState : NSObject
293295@property (readonly , nonatomic , nullable ) NSString * emailUserId; // The new Email user ID
294296@property (readonly , nonatomic , nullable ) NSString *emailAddress;
295- @property (readonly , nonatomic ) BOOL subscribed ;
297+ @property (readonly , nonatomic ) BOOL isSubscribed ;
296298- (NSDictionary * _Nonnull)toDictionary ;
297299@end
298300
@@ -316,14 +318,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
316318- (void )onOSEmailSubscriptionChanged : (OSEmailSubscriptionStateChanges* _Nonnull)stateChanges ;
317319@end
318320
319- // Permission+Subscription Classes
320- @interface OSPermissionSubscriptionState : NSObject
321-
322- @property (readonly , nonnull ) OSPermissionState* permissionStatus;
323- @property (readonly , nonnull ) OSSubscriptionState* subscriptionStatus;
324- @property (readonly , nonnull ) OSEmailSubscriptionState *emailSubscriptionStatus;
325- - (NSDictionary * _Nonnull)toDictionary ;
326-
321+ @protocol OSPermissionObserver <NSObject >
322+ - (void )onOSPermissionChanged : (OSPermissionStateChanges* _Nonnull)stateChanges ;
327323@end
328324
329325@interface OSDeviceState : NSObject
@@ -368,7 +364,7 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
368364 */
369365@property (readonly , nullable ) NSString * emailAddress;
370366
371- - ( instancetype ) initWithSubscriptionState : (OSPermissionSubscriptionState *) state ;
367+ @property ( readonly ) BOOL isEmailSubscribed ;
372368
373369// Convert the class into a NSDictionary
374370- (NSDictionary *_Nonnull)jsonRepresentation ;
@@ -384,19 +380,6 @@ typedef void (^OSFailureBlock)(NSError* error);
384380/* Block for handling outcome event being sent successfully*/
385381typedef void (^OSSendOutcomeSuccess)(OSOutcomeEvent* outcome);
386382
387- /* Dictionary of keys to pass alongside the init settings*/
388-
389- /* Enable In-App display of Launch URLs*/
390- extern NSString * const kOSSettingsKeyInAppLaunchURL ;
391-
392- /* iOS 12 +
393- Used to determine if the app is able to present it's
394- own customized Notification Settings view
395- */
396- extern NSString * const kOSSettingsKeyProvidesAppNotificationSettings ;
397-
398-
399-
400383// ======= OneSignal Class Interface =========
401384@interface OneSignal : NSObject
402385
@@ -408,16 +391,14 @@ extern NSString* const ONESIGNAL_VERSION;
408391
409392+ (void )disablePush : (BOOL )disable ;
410393
411- + (NSString * _Nonnull)parseNSErrorAsJsonString : (NSError * _Nonnull)error ;
412-
413394// Only used for wrapping SDKs, such as Unity, Cordova, Xamarin, etc.
414395+ (void )setMSDKType : (NSString * _Nonnull)type ;
415396
416397#pragma mark Initialization
417398+ (void )setAppId : (NSString * _Nonnull)newAppId ;
418399+ (void )initWithLaunchOptions : (NSDictionary * _Nullable)launchOptions ;
419- // TODO: Remove before releasing major release 3.0.0
420- + (void )setAppSettings : ( NSDictionary * _Nonnull) settings ;
400+ + ( void ) setLaunchURLsInApp : ( BOOL ) launchInApp ;
401+ + (void )setProvidesNotificationSettingsView : ( BOOL ) providesView ;
421402
422403#pragma mark Logging
423404typedef NS_ENUM (NSUInteger , ONE_S_LOG_LEVEL) {
@@ -431,7 +412,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
431412};
432413
433414+ (void )setLogLevel : (ONE_S_LOG_LEVEL)logLevel visualLevel : (ONE_S_LOG_LEVEL)visualLogLevel ;
434- + (void )onesignal_Log : (ONE_S_LOG_LEVEL)logLevel message : (NSString * _Nonnull)message ;
415+ + (void )onesignalLog : (ONE_S_LOG_LEVEL)logLevel message : (NSString * _Nonnull)message ;
435416
436417#pragma mark Prompt For Push
437418typedef void (^OSUserResponseBlock)(BOOL accepted);
@@ -492,7 +473,6 @@ typedef void (^OSInAppMessageClickBlock)(OSInAppMessageAction * _Nonnull action)
492473
493474#pragma mark Permission, Subscription, and Email Observers
494475NS_ASSUME_NONNULL_BEGIN
495- + (OSPermissionSubscriptionState*)getPermissionSubscriptionState ;
496476
497477+ (void )addPermissionObserver : (NSObject <OSPermissionObserver>*)observer ;
498478+ (void )removePermissionObserver : (NSObject <OSPermissionObserver>*)observer ;
@@ -527,11 +507,14 @@ typedef void (^OSEmailSuccessBlock)();
527507
528508#pragma mark External User Id
529509// Typedefs defining completion blocks for updating the external user id
530- typedef void (^OSUpdateExternalUserIdBlock)(NSDictionary * results);
510+ typedef void (^OSUpdateExternalUserIdFailureBlock)(NSError *error);
511+ typedef void (^OSUpdateExternalUserIdSuccessBlock)(NSDictionary *results);
512+
531513+ (void )setExternalUserId : (NSString * _Nonnull)externalId ;
532- + (void )setExternalUserId : (NSString * _Nonnull)externalId withCompletion : (OSUpdateExternalUserIdBlock _Nullable)completionBlock ;
514+ + (void )setExternalUserId : (NSString * _Nonnull)externalId withSuccess : (OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure : (OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock ;
515+ + (void )setExternalUserId : (NSString *)externalId withExternalIdAuthHashToken : (NSString *)hashToken withSuccess : (OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure : (OSUpdateExternalUserIdFailureBlock _Nullable)failureBlock ;
533516+ (void )removeExternalUserId ;
534- + (void )removeExternalUserId : (OSUpdateExternalUserIdBlock _Nullable)completionBlock ;
517+ + (void )removeExternalUserId : (OSUpdateExternalUserIdSuccessBlock _Nullable)successBlock withFailure : (OSUpdateExternalUserIdFailureBlock _Nullable) failureBlock ;
535518
536519#pragma mark In-App Messaging
537520+ (BOOL )isInAppMessagingPaused ;
0 commit comments