Skip to content

Commit 3379178

Browse files
authored
Merge pull request #911 from OneSignal/release-3.4.0
Release 3.4.0
2 parents f7da811 + de0e229 commit 3379178

File tree

16 files changed

+330
-62
lines changed

16 files changed

+330
-62
lines changed

OneSignal.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneSignal"
3-
s.version = "3.3.0"
3+
s.version = "3.4.0"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

OneSignalDynamic.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneSignalDynamic"
3-
s.version = "3.3.0"
3+
s.version = "3.4.0"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

OneSignalXCFramework.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneSignalXCFramework"
3-
s.version = "3.3.0"
3+
s.version = "3.4.0"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

iOS_SDK/OneSignalSDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
294294

295295
@end
296296

297-
@interface OSEmailSubscriptionState : NSObject
298-
@property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID
299-
@property (readonly, nonatomic, nullable) NSString *emailAddress;
300-
@property (readonly, nonatomic) BOOL isSubscribed;
301-
- (NSDictionary* _Nonnull)toDictionary;
302-
@end
303-
304297
@interface OSSubscriptionStateChanges : NSObject
305298
@property (readonly, nonnull) OSSubscriptionState* to;
306299
@property (readonly, nonnull) OSSubscriptionState* from;
307300
- (NSDictionary* _Nonnull)toDictionary;
308301
@end
309302

303+
@interface OSEmailSubscriptionState : NSObject
304+
@property (readonly, nonatomic, nullable) NSString *emailUserId; // The new Email user ID
305+
@property (readonly, nonatomic, nullable) NSString *emailAddress;
306+
@property (readonly, nonatomic) BOOL isSubscribed;
307+
- (NSDictionary* _Nonnull)toDictionary;
308+
@end
309+
310310
@interface OSEmailSubscriptionStateChanges : NSObject
311311
@property (readonly, nonnull) OSEmailSubscriptionState* to;
312312
@property (readonly, nonnull) OSEmailSubscriptionState* from;
313313
- (NSDictionary* _Nonnull)toDictionary;
314314
@end
315315

316+
@interface OSSMSSubscriptionState : NSObject
317+
@property (readonly, nonatomic, nullable) NSString* smsUserId;
318+
@property (readonly, nonatomic, nullable) NSString *smsNumber;
319+
@property (readonly, nonatomic) BOOL isSubscribed;
320+
- (NSDictionary* _Nonnull)toDictionary;
321+
@end
322+
323+
@interface OSSMSSubscriptionStateChanges : NSObject
324+
@property (readonly, nonnull) OSSMSSubscriptionState* to;
325+
@property (readonly, nonnull) OSSMSSubscriptionState* from;
326+
- (NSDictionary* _Nonnull)toDictionary;
327+
@end
328+
329+
@protocol OSPermissionObserver <NSObject>
330+
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
331+
@end
332+
316333
@protocol OSSubscriptionObserver <NSObject>
317334
- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges;
318335
@end
@@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
321338
- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges;
322339
@end
323340

324-
@protocol OSPermissionObserver <NSObject>
325-
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
341+
@protocol OSSMSSubscriptionObserver <NSObject>
342+
- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges;
326343
@end
327344

328345
@interface OSDeviceState : NSObject
@@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
369386

370387
@property (readonly) BOOL isEmailSubscribed;
371388

389+
/**
390+
* Get the user sms id
391+
* @return sms id if user sms number was registered, otherwise null
392+
*/
393+
@property (readonly, nullable) NSString* smsUserId;
394+
/**
395+
* Get the user sms number, number may start with + and continue with numbers or contain only numbers
396+
* e.g: +11231231231 or 11231231231
397+
* @return sms number if set, otherwise null
398+
*/
399+
@property (readonly, nullable) NSString* smsNumber;
400+
401+
@property (readonly) BOOL isSMSSubscribed;
402+
372403
// Convert the class into a NSDictionary
373404
- (NSDictionary *_Nonnull)jsonRepresentation;
374405

@@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN
485516

486517
+ (void)addEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;
487518
+ (void)removeEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;
519+
520+
+ (void)addSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
521+
+ (void)removeSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
488522
NS_ASSUME_NONNULL_END
489523

490524
#pragma mark Email
@@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)();
507541
+ (void)logoutEmail;
508542
+ (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock;
509543

544+
#pragma mark SMS
545+
// Typedefs defining completion blocks for SMS & simultaneous HTTP requests
546+
typedef void (^OSSMSFailureBlock)(NSError *error);
547+
typedef void (^OSSMSSuccessBlock)(NSDictionary *results);
548+
549+
// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers
550+
// e.g: +11231231231 or 11231231231
551+
// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client.
552+
// For security purposes, the smsAuthToken should be generated by your backend server.
553+
// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter.
554+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken;
555+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock;
556+
557+
// Sets SMS without an authentication token
558+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber;
559+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock;
560+
561+
// Logs the device out of the current sms number.
562+
+ (void)logoutSMSNumber;
563+
+ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock;
510564

511565
#pragma mark External User Id
512566
// Typedefs defining completion blocks for updating the external user id
Binary file not shown.

iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@
409409
CA810FD2202BA97600A60FED /* OSEmailSubscription.m in Sources */ = {isa = PBXBuildFile; fileRef = CA810FD0202BA97300A60FED /* OSEmailSubscription.m */; };
410410
CA810FD3202BA97600A60FED /* OSEmailSubscription.m in Sources */ = {isa = PBXBuildFile; fileRef = CA810FD0202BA97300A60FED /* OSEmailSubscription.m */; };
411411
CA85C15320604AEA003AB529 /* RequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA85C15220604AEA003AB529 /* RequestTests.m */; };
412-
CA8E18FC2193A1A5009DA223 /* NSTimerOverrider.h in Headers */ = {isa = PBXBuildFile; fileRef = CA8E18FA2193A1A5009DA223 /* NSTimerOverrider.h */; };
413412
CA8E18FF2193A1A5009DA223 /* NSTimerOverrider.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8E18FB2193A1A5009DA223 /* NSTimerOverrider.m */; };
414413
CA8E19022193C6B0009DA223 /* InAppMessagingIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8E19012193C6B0009DA223 /* InAppMessagingIntegrationTests.m */; };
415414
CA8E19052193C76D009DA223 /* OSInAppMessagingHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = CA8E19032193C76D009DA223 /* OSInAppMessagingHelpers.h */; };
@@ -1502,7 +1501,6 @@
15021501
912412411E73342200E41FD7 /* UNUserNotificationCenter+OneSignal.h in Headers */,
15031502
DE9A5DAA25D1FD6B00FCEC21 /* OSPlayerTags.h in Headers */,
15041503
7AF98684244A32D900C36EAE /* OSOutcomeEventsV2Repository.h in Headers */,
1505-
CA8E18FC2193A1A5009DA223 /* NSTimerOverrider.h in Headers */,
15061504
91B6EA451E86555200B5CF01 /* OSObservable.h in Headers */,
15071505
DE367CCA24EEF2C800165207 /* OSInAppMessagePage.h in Headers */,
15081506
CACBAA9C218A6243000ACAA5 /* OSInAppMessageView.h in Headers */,

iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/Info.plist

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>ios-arm64_armv7_armv7s</string>
9+
<string>ios-arm64_i386_x86_64-simulator</string>
1010
<key>LibraryPath</key>
1111
<string>OneSignal.framework</string>
1212
<key>SupportedArchitectures</key>
1313
<array>
1414
<string>arm64</string>
15-
<string>armv7</string>
16-
<string>armv7s</string>
15+
<string>i386</string>
16+
<string>x86_64</string>
1717
</array>
1818
<key>SupportedPlatform</key>
1919
<string>ios</string>
20+
<key>SupportedPlatformVariant</key>
21+
<string>simulator</string>
2022
</dict>
2123
<dict>
2224
<key>LibraryIdentifier</key>
23-
<string>ios-arm64_i386_x86_64-simulator</string>
25+
<string>ios-arm64_armv7_armv7s</string>
2426
<key>LibraryPath</key>
2527
<string>OneSignal.framework</string>
2628
<key>SupportedArchitectures</key>
2729
<array>
2830
<string>arm64</string>
29-
<string>i386</string>
30-
<string>x86_64</string>
31+
<string>armv7</string>
32+
<string>armv7s</string>
3133
</array>
3234
<key>SupportedPlatform</key>
3335
<string>ios</string>
34-
<key>SupportedPlatformVariant</key>
35-
<string>simulator</string>
3636
</dict>
3737
<dict>
3838
<key>LibraryIdentifier</key>

iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework/Headers/OneSignal.h

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,25 +294,42 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
294294

295295
@end
296296

297-
@interface OSEmailSubscriptionState : NSObject
298-
@property (readonly, nonatomic, nullable) NSString* emailUserId; // The new Email user ID
299-
@property (readonly, nonatomic, nullable) NSString *emailAddress;
300-
@property (readonly, nonatomic) BOOL isSubscribed;
301-
- (NSDictionary* _Nonnull)toDictionary;
302-
@end
303-
304297
@interface OSSubscriptionStateChanges : NSObject
305298
@property (readonly, nonnull) OSSubscriptionState* to;
306299
@property (readonly, nonnull) OSSubscriptionState* from;
307300
- (NSDictionary* _Nonnull)toDictionary;
308301
@end
309302

303+
@interface OSEmailSubscriptionState : NSObject
304+
@property (readonly, nonatomic, nullable) NSString *emailUserId; // The new Email user ID
305+
@property (readonly, nonatomic, nullable) NSString *emailAddress;
306+
@property (readonly, nonatomic) BOOL isSubscribed;
307+
- (NSDictionary* _Nonnull)toDictionary;
308+
@end
309+
310310
@interface OSEmailSubscriptionStateChanges : NSObject
311311
@property (readonly, nonnull) OSEmailSubscriptionState* to;
312312
@property (readonly, nonnull) OSEmailSubscriptionState* from;
313313
- (NSDictionary* _Nonnull)toDictionary;
314314
@end
315315

316+
@interface OSSMSSubscriptionState : NSObject
317+
@property (readonly, nonatomic, nullable) NSString* smsUserId;
318+
@property (readonly, nonatomic, nullable) NSString *smsNumber;
319+
@property (readonly, nonatomic) BOOL isSubscribed;
320+
- (NSDictionary* _Nonnull)toDictionary;
321+
@end
322+
323+
@interface OSSMSSubscriptionStateChanges : NSObject
324+
@property (readonly, nonnull) OSSMSSubscriptionState* to;
325+
@property (readonly, nonnull) OSSMSSubscriptionState* from;
326+
- (NSDictionary* _Nonnull)toDictionary;
327+
@end
328+
329+
@protocol OSPermissionObserver <NSObject>
330+
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
331+
@end
332+
316333
@protocol OSSubscriptionObserver <NSObject>
317334
- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges;
318335
@end
@@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
321338
- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges;
322339
@end
323340

324-
@protocol OSPermissionObserver <NSObject>
325-
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
341+
@protocol OSSMSSubscriptionObserver <NSObject>
342+
- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges;
326343
@end
327344

328345
@interface OSDeviceState : NSObject
@@ -369,6 +386,20 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
369386

370387
@property (readonly) BOOL isEmailSubscribed;
371388

389+
/**
390+
* Get the user sms id
391+
* @return sms id if user sms number was registered, otherwise null
392+
*/
393+
@property (readonly, nullable) NSString* smsUserId;
394+
/**
395+
* Get the user sms number, number may start with + and continue with numbers or contain only numbers
396+
* e.g: +11231231231 or 11231231231
397+
* @return sms number if set, otherwise null
398+
*/
399+
@property (readonly, nullable) NSString* smsNumber;
400+
401+
@property (readonly) BOOL isSMSSubscribed;
402+
372403
// Convert the class into a NSDictionary
373404
- (NSDictionary *_Nonnull)jsonRepresentation;
374405

@@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN
485516

486517
+ (void)addEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;
487518
+ (void)removeEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;
519+
520+
+ (void)addSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
521+
+ (void)removeSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
488522
NS_ASSUME_NONNULL_END
489523

490524
#pragma mark Email
@@ -507,6 +541,26 @@ typedef void (^OSEmailSuccessBlock)();
507541
+ (void)logoutEmail;
508542
+ (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock;
509543

544+
#pragma mark SMS
545+
// Typedefs defining completion blocks for SMS & simultaneous HTTP requests
546+
typedef void (^OSSMSFailureBlock)(NSError *error);
547+
typedef void (^OSSMSSuccessBlock)(NSDictionary *results);
548+
549+
// Allows you to set the SMS for this user. SMS number may start with + and continue with numbers or contain only numbers
550+
// e.g: +11231231231 or 11231231231
551+
// SMS Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client.
552+
// For security purposes, the smsAuthToken should be generated by your backend server.
553+
// If you do not have a backend server for your application, use the version of thge setSMSNumber: method without an smsAuthToken parameter.
554+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken;
555+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSMSAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock;
556+
557+
// Sets SMS without an authentication token
558+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber;
559+
+ (void)setSMSNumber:(NSString * _Nonnull)smsNumber withSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock;
560+
561+
// Logs the device out of the current sms number.
562+
+ (void)logoutSMSNumber;
563+
+ (void)logoutSMSNumberWithSuccess:(OSSMSSuccessBlock _Nullable)successBlock withFailure:(OSSMSFailureBlock _Nullable)failureBlock;
510564

511565
#pragma mark External User Id
512566
// Typedefs defining completion blocks for updating the external user id

0 commit comments

Comments
 (0)