diff --git a/OneSignal.podspec b/OneSignal.podspec index bda5689e8..289245846 100755 --- a/OneSignal.podspec +++ b/OneSignal.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OneSignal" - s.version = "3.3.0" + s.version = "3.4.0" s.summary = "OneSignal push notification library for mobile apps." s.homepage = "https://onesignal.com" s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/OneSignalDynamic.podspec b/OneSignalDynamic.podspec index 889095ee4..e24d5341d 100644 --- a/OneSignalDynamic.podspec +++ b/OneSignalDynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OneSignalDynamic" - s.version = "3.3.0" + s.version = "3.4.0" s.summary = "OneSignal push notification library for mobile apps." s.homepage = "https://onesignal.com" s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/OneSignalXCFramework.podspec b/OneSignalXCFramework.podspec index 7fc19e342..a26cd69be 100644 --- a/OneSignalXCFramework.podspec +++ b/OneSignalXCFramework.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "OneSignalXCFramework" - s.version = "3.3.0" + s.version = "3.4.0" s.summary = "OneSignal push notification library for mobile apps." s.homepage = "https://onesignal.com" s.license = { :type => 'MIT', :file => 'LICENSE' } 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 600065e7b..1848c0c3b 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 @@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @end -@interface OSEmailSubscriptionState : NSObject -@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, nonnull) OSSubscriptionState* to; @property (readonly, nonnull) OSSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSEmailSubscriptionState : NSObject +@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 OSEmailSubscriptionStateChanges : NSObject @property (readonly, nonnull) OSEmailSubscriptionState* to; @property (readonly, nonnull) OSEmailSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSSMSSubscriptionState : NSObject +@property (readonly, nonatomic, nullable) NSString* smsUserId; +@property (readonly, nonatomic, nullable) NSString *smsNumber; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@interface OSSMSSubscriptionStateChanges : NSObject +@property (readonly, nonnull) OSSMSSubscriptionState* to; +@property (readonly, nonnull) OSSMSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@protocol OSPermissionObserver +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@end + @protocol OSSubscriptionObserver - (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { - (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end -@protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@protocol OSSMSSubscriptionObserver +- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges; @end @interface OSDeviceState : NSObject @@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly) BOOL isEmailSubscribed; +/** + * Get the user sms id + * @return sms id if user sms number was registered, otherwise null + */ +@property (readonly, nullable) NSString* smsUserId; +/** + * Get the user sms number, number may start with + and continue with numbers or contain only numbers + * e.g: +11231231231 or 11231231231 + * @return sms number if set, otherwise null + */ +@property (readonly, nullable) NSString* smsNumber; + +@property (readonly) BOOL isSMSSubscribed; + // Convert the class into a NSDictionary - (NSDictionary *_Nonnull)jsonRepresentation; @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN + (void)addEmailSubscriptionObserver:(NSObject*)observer; + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + ++ (void)addSMSSubscriptionObserver:(NSObject*)observer; ++ (void)removeSMSSubscriptionObserver:(NSObject*)observer; NS_ASSUME_NONNULL_END #pragma mark Email @@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmail; + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; +#pragma mark SMS +// Typedefs defining completion blocks for SMS & simultaneous HTTP requests +typedef void (^OSSMSFailureBlock)(NSError *error); +typedef void (^OSSMSSuccessBlock)(NSDictionary *results); + +// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers +// e.g: +11231231231 or 11231231231 +// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client. +// For security purposes, the smsAuthToken should be generated by your backend server. +// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter. ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Sets SMS without an authentication token ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Logs the device out of the current sms number. ++ (void)logoutSMSNumber; ++ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; #pragma mark External User Id // Typedefs defining completion blocks for updating the external user id diff --git a/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/OneSignal index 4122b1f12..03c4cc04e 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/OneSignal.xcodeproj/project.pbxproj b/iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj index c2b2dc4a5..6bd832790 100644 --- a/iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj +++ b/iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj @@ -409,7 +409,6 @@ CA810FD2202BA97600A60FED /* OSEmailSubscription.m in Sources */ = {isa = PBXBuildFile; fileRef = CA810FD0202BA97300A60FED /* OSEmailSubscription.m */; }; CA810FD3202BA97600A60FED /* OSEmailSubscription.m in Sources */ = {isa = PBXBuildFile; fileRef = CA810FD0202BA97300A60FED /* OSEmailSubscription.m */; }; CA85C15320604AEA003AB529 /* RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA85C15220604AEA003AB529 /* RequestTests.m */; }; - CA8E18FC2193A1A5009DA223 /* NSTimerOverrider.h in Headers */ = {isa = PBXBuildFile; fileRef = CA8E18FA2193A1A5009DA223 /* NSTimerOverrider.h */; }; CA8E18FF2193A1A5009DA223 /* NSTimerOverrider.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8E18FB2193A1A5009DA223 /* NSTimerOverrider.m */; }; CA8E19022193C6B0009DA223 /* InAppMessagingIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8E19012193C6B0009DA223 /* InAppMessagingIntegrationTests.m */; }; CA8E19052193C76D009DA223 /* OSInAppMessagingHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = CA8E19032193C76D009DA223 /* OSInAppMessagingHelpers.h */; }; @@ -1502,7 +1501,6 @@ 912412411E73342200E41FD7 /* UNUserNotificationCenter+OneSignal.h in Headers */, DE9A5DAA25D1FD6B00FCEC21 /* OSPlayerTags.h in Headers */, 7AF98684244A32D900C36EAE /* OSOutcomeEventsV2Repository.h in Headers */, - CA8E18FC2193A1A5009DA223 /* NSTimerOverrider.h in Headers */, 91B6EA451E86555200B5CF01 /* OSObservable.h in Headers */, DE367CCA24EEF2C800165207 /* OSInAppMessagePage.h in Headers */, CACBAA9C218A6243000ACAA5 /* OSInAppMessageView.h in Headers */, diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist index 786244220..8e3cf6147 100644 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist @@ -6,33 +6,33 @@ LibraryIdentifier - ios-arm64_armv7_armv7s + ios-arm64_i386_x86_64-simulator LibraryPath OneSignal.framework SupportedArchitectures arm64 - armv7 - armv7s + i386 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator LibraryIdentifier - ios-arm64_i386_x86_64-simulator + ios-arm64_armv7_armv7s LibraryPath OneSignal.framework SupportedArchitectures arm64 - i386 - x86_64 + armv7 + armv7s SupportedPlatform ios - SupportedPlatformVariant - simulator LibraryIdentifier diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/Headers/OneSignal.h index 600065e7b..1848c0c3b 100755 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/Headers/OneSignal.h @@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @end -@interface OSEmailSubscriptionState : NSObject -@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, nonnull) OSSubscriptionState* to; @property (readonly, nonnull) OSSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSEmailSubscriptionState : NSObject +@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 OSEmailSubscriptionStateChanges : NSObject @property (readonly, nonnull) OSEmailSubscriptionState* to; @property (readonly, nonnull) OSEmailSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSSMSSubscriptionState : NSObject +@property (readonly, nonatomic, nullable) NSString* smsUserId; +@property (readonly, nonatomic, nullable) NSString *smsNumber; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@interface OSSMSSubscriptionStateChanges : NSObject +@property (readonly, nonnull) OSSMSSubscriptionState* to; +@property (readonly, nonnull) OSSMSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@protocol OSPermissionObserver +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@end + @protocol OSSubscriptionObserver - (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { - (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end -@protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@protocol OSSMSSubscriptionObserver +- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges; @end @interface OSDeviceState : NSObject @@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly) BOOL isEmailSubscribed; +/** + * Get the user sms id + * @return sms id if user sms number was registered, otherwise null + */ +@property (readonly, nullable) NSString* smsUserId; +/** + * Get the user sms number, number may start with + and continue with numbers or contain only numbers + * e.g: +11231231231 or 11231231231 + * @return sms number if set, otherwise null + */ +@property (readonly, nullable) NSString* smsNumber; + +@property (readonly) BOOL isSMSSubscribed; + // Convert the class into a NSDictionary - (NSDictionary *_Nonnull)jsonRepresentation; @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN + (void)addEmailSubscriptionObserver:(NSObject*)observer; + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + ++ (void)addSMSSubscriptionObserver:(NSObject*)observer; ++ (void)removeSMSSubscriptionObserver:(NSObject*)observer; NS_ASSUME_NONNULL_END #pragma mark Email @@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmail; + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; +#pragma mark SMS +// Typedefs defining completion blocks for SMS & simultaneous HTTP requests +typedef void (^OSSMSFailureBlock)(NSError *error); +typedef void (^OSSMSSuccessBlock)(NSDictionary *results); + +// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers +// e.g: +11231231231 or 11231231231 +// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client. +// For security purposes, the smsAuthToken should be generated by your backend server. +// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter. ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Sets SMS without an authentication token ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Logs the device out of the current sms number. ++ (void)logoutSMSNumber; ++ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; #pragma mark External User Id // Typedefs defining completion blocks for updating the external user id diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/OneSignal b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/OneSignal index 2c454a07b..01072d59d 100755 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/OneSignal and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h index 600065e7b..1848c0c3b 100755 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/Headers/OneSignal.h @@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @end -@interface OSEmailSubscriptionState : NSObject -@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, nonnull) OSSubscriptionState* to; @property (readonly, nonnull) OSSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSEmailSubscriptionState : NSObject +@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 OSEmailSubscriptionStateChanges : NSObject @property (readonly, nonnull) OSEmailSubscriptionState* to; @property (readonly, nonnull) OSEmailSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSSMSSubscriptionState : NSObject +@property (readonly, nonatomic, nullable) NSString* smsUserId; +@property (readonly, nonatomic, nullable) NSString *smsNumber; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@interface OSSMSSubscriptionStateChanges : NSObject +@property (readonly, nonnull) OSSMSSubscriptionState* to; +@property (readonly, nonnull) OSSMSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@protocol OSPermissionObserver +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@end + @protocol OSSubscriptionObserver - (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { - (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end -@protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@protocol OSSMSSubscriptionObserver +- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges; @end @interface OSDeviceState : NSObject @@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly) BOOL isEmailSubscribed; +/** + * Get the user sms id + * @return sms id if user sms number was registered, otherwise null + */ +@property (readonly, nullable) NSString* smsUserId; +/** + * Get the user sms number, number may start with + and continue with numbers or contain only numbers + * e.g: +11231231231 or 11231231231 + * @return sms number if set, otherwise null + */ +@property (readonly, nullable) NSString* smsNumber; + +@property (readonly) BOOL isSMSSubscribed; + // Convert the class into a NSDictionary - (NSDictionary *_Nonnull)jsonRepresentation; @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN + (void)addEmailSubscriptionObserver:(NSObject*)observer; + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + ++ (void)addSMSSubscriptionObserver:(NSObject*)observer; ++ (void)removeSMSSubscriptionObserver:(NSObject*)observer; NS_ASSUME_NONNULL_END #pragma mark Email @@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmail; + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; +#pragma mark SMS +// Typedefs defining completion blocks for SMS & simultaneous HTTP requests +typedef void (^OSSMSFailureBlock)(NSError *error); +typedef void (^OSSMSSuccessBlock)(NSDictionary *results); + +// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers +// e.g: +11231231231 or 11231231231 +// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client. +// For security purposes, the smsAuthToken should be generated by your backend server. +// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter. ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Sets SMS without an authentication token ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Logs the device out of the current sms number. ++ (void)logoutSMSNumber; ++ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; #pragma mark External User Id // Typedefs defining completion blocks for updating the external user id diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/OneSignal b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/OneSignal index 1cc363d7d..69edeab66 100755 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/OneSignal and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources index 5bc17df5e..bd74f811b 100644 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_i386_x86_64-simulator/OneSignal.framework/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Headers/OneSignal.h - T2jK0NL+76HnVWR1Ecpi2L6U75g= + BLD4jYD/TpJymJPeuBhvFcyFbgw= Info.plist @@ -23,11 +23,11 @@ hash - T2jK0NL+76HnVWR1Ecpi2L6U75g= + BLD4jYD/TpJymJPeuBhvFcyFbgw= hash2 - yE+S5mcVx6WPsapKnR/BvgGTU2dMj7jti0j7++IrZeA= + ejbMIRRYTnU9t5kqK7YwnDP4rbpTj+sdUflpW0FmvoM= Modules/module.modulemap diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h index 600065e7b..1848c0c3b 100755 --- a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/Headers/OneSignal.h @@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @end -@interface OSEmailSubscriptionState : NSObject -@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, nonnull) OSSubscriptionState* to; @property (readonly, nonnull) OSSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSEmailSubscriptionState : NSObject +@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 OSEmailSubscriptionStateChanges : NSObject @property (readonly, nonnull) OSEmailSubscriptionState* to; @property (readonly, nonnull) OSEmailSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSSMSSubscriptionState : NSObject +@property (readonly, nonatomic, nullable) NSString* smsUserId; +@property (readonly, nonatomic, nullable) NSString *smsNumber; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@interface OSSMSSubscriptionStateChanges : NSObject +@property (readonly, nonnull) OSSMSSubscriptionState* to; +@property (readonly, nonnull) OSSMSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@protocol OSPermissionObserver +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@end + @protocol OSSubscriptionObserver - (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { - (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end -@protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@protocol OSSMSSubscriptionObserver +- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges; @end @interface OSDeviceState : NSObject @@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly) BOOL isEmailSubscribed; +/** + * Get the user sms id + * @return sms id if user sms number was registered, otherwise null + */ +@property (readonly, nullable) NSString* smsUserId; +/** + * Get the user sms number, number may start with + and continue with numbers or contain only numbers + * e.g: +11231231231 or 11231231231 + * @return sms number if set, otherwise null + */ +@property (readonly, nullable) NSString* smsNumber; + +@property (readonly) BOOL isSMSSubscribed; + // Convert the class into a NSDictionary - (NSDictionary *_Nonnull)jsonRepresentation; @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN + (void)addEmailSubscriptionObserver:(NSObject*)observer; + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + ++ (void)addSMSSubscriptionObserver:(NSObject*)observer; ++ (void)removeSMSSubscriptionObserver:(NSObject*)observer; NS_ASSUME_NONNULL_END #pragma mark Email @@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmail; + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; +#pragma mark SMS +// Typedefs defining completion blocks for SMS & simultaneous HTTP requests +typedef void (^OSSMSFailureBlock)(NSError *error); +typedef void (^OSSMSSuccessBlock)(NSDictionary *results); + +// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers +// e.g: +11231231231 or 11231231231 +// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client. +// For security purposes, the smsAuthToken should be generated by your backend server. +// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter. ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Sets SMS without an authentication token ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Logs the device out of the current sms number. ++ (void)logoutSMSNumber; ++ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; #pragma mark External User Id // Typedefs defining completion blocks for updating the external user id diff --git a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal index 16176f2f9..06483c751 100755 Binary files a/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal and b/iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_x86_64-maccatalyst/OneSignal.framework/Versions/A/OneSignal differ diff --git a/iOS_SDK/OneSignalSDK/Source/OneSignal.m b/iOS_SDK/OneSignalSDK/Source/OneSignal.m index 1dc37d1c9..3a38d5d31 100755 --- a/iOS_SDK/OneSignalSDK/Source/OneSignal.m +++ b/iOS_SDK/OneSignalSDK/Source/OneSignal.m @@ -126,7 +126,7 @@ @interface OneSignal (SessionStatusDelegate) @implementation OneSignal -NSString* const ONESIGNAL_VERSION = @"030300"; +NSString* const ONESIGNAL_VERSION = @"030400"; static NSString* mSDKType = @"native"; static BOOL coldStartFromTapOnNotification = NO; static BOOL shouldDelaySubscriptionUpdate = false; diff --git a/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h b/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h index 600065e7b..1848c0c3b 100755 --- a/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h +++ b/iOS_SDK/OneSignalSDK/SwiftPM/Public/Headers/OneSignal/OneSignal.h @@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @end -@interface OSEmailSubscriptionState : NSObject -@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, nonnull) OSSubscriptionState* to; @property (readonly, nonnull) OSSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSEmailSubscriptionState : NSObject +@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 OSEmailSubscriptionStateChanges : NSObject @property (readonly, nonnull) OSEmailSubscriptionState* to; @property (readonly, nonnull) OSEmailSubscriptionState* from; - (NSDictionary* _Nonnull)toDictionary; @end +@interface OSSMSSubscriptionState : NSObject +@property (readonly, nonatomic, nullable) NSString* smsUserId; +@property (readonly, nonatomic, nullable) NSString *smsNumber; +@property (readonly, nonatomic) BOOL isSubscribed; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@interface OSSMSSubscriptionStateChanges : NSObject +@property (readonly, nonnull) OSSMSSubscriptionState* to; +@property (readonly, nonnull) OSSMSSubscriptionState* from; +- (NSDictionary* _Nonnull)toDictionary; +@end + +@protocol OSPermissionObserver +- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@end + @protocol OSSubscriptionObserver - (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges; @end @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { - (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges; @end -@protocol OSPermissionObserver -- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges; +@protocol OSSMSSubscriptionObserver +- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges; @end @interface OSDeviceState : NSObject @@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) { @property (readonly) BOOL isEmailSubscribed; +/** + * Get the user sms id + * @return sms id if user sms number was registered, otherwise null + */ +@property (readonly, nullable) NSString* smsUserId; +/** + * Get the user sms number, number may start with + and continue with numbers or contain only numbers + * e.g: +11231231231 or 11231231231 + * @return sms number if set, otherwise null + */ +@property (readonly, nullable) NSString* smsNumber; + +@property (readonly) BOOL isSMSSubscribed; + // Convert the class into a NSDictionary - (NSDictionary *_Nonnull)jsonRepresentation; @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN + (void)addEmailSubscriptionObserver:(NSObject*)observer; + (void)removeEmailSubscriptionObserver:(NSObject*)observer; + ++ (void)addSMSSubscriptionObserver:(NSObject*)observer; ++ (void)removeSMSSubscriptionObserver:(NSObject*)observer; NS_ASSUME_NONNULL_END #pragma mark Email @@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)(); + (void)logoutEmail; + (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock; +#pragma mark SMS +// Typedefs defining completion blocks for SMS & simultaneous HTTP requests +typedef void (^OSSMSFailureBlock)(NSError *error); +typedef void (^OSSMSSuccessBlock)(NSDictionary *results); + +// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers +// e.g: +11231231231 or 11231231231 +// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client. +// For security purposes, the smsAuthToken should be generated by your backend server. +// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter. ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Sets SMS without an authentication token ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber; ++ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; + +// Logs the device out of the current sms number. ++ (void)logoutSMSNumber; ++ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock; #pragma mark External User Id // Typedefs defining completion blocks for updating the external user id