Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OneSignal.podspec
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down
2 changes: 1 addition & 1 deletion OneSignalDynamic.podspec
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down
2 changes: 1 addition & 1 deletion OneSignalXCFramework.podspec
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NSObject>
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
@end

@protocol OSSubscriptionObserver <NSObject>
- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges;
@end
Expand All @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges;
@end

@protocol OSPermissionObserver <NSObject>
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
@protocol OSSMSSubscriptionObserver <NSObject>
- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges;
@end

@interface OSDeviceState : NSObject
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN

+ (void)addEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;
+ (void)removeEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;

+ (void)addSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
+ (void)removeSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
NS_ASSUME_NONNULL_END

#pragma mark Email
Expand All @@ -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
Expand Down
Binary file not shown.
2 changes: 0 additions & 2 deletions iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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 */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7_armv7s</string>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OneSignal.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>armv7s</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>ios-arm64_armv7_armv7s</string>
<key>LibraryPath</key>
<string>OneSignal.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
<string>armv7</string>
<string>armv7s</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NSObject>
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
@end

@protocol OSSubscriptionObserver <NSObject>
- (void)onOSSubscriptionChanged:(OSSubscriptionStateChanges* _Nonnull)stateChanges;
@end
Expand All @@ -321,8 +338,8 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
- (void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges* _Nonnull)stateChanges;
@end

@protocol OSPermissionObserver <NSObject>
- (void)onOSPermissionChanged:(OSPermissionStateChanges* _Nonnull)stateChanges;
@protocol OSSMSSubscriptionObserver <NSObject>
- (void)onOSSMSSubscriptionChanged:(OSSMSSubscriptionStateChanges* _Nonnull)stateChanges;
@end

@interface OSDeviceState : NSObject
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -485,6 +516,9 @@ NS_ASSUME_NONNULL_BEGIN

+ (void)addEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;
+ (void)removeEmailSubscriptionObserver:(NSObject<OSEmailSubscriptionObserver>*)observer;

+ (void)addSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
+ (void)removeSMSSubscriptionObserver:(NSObject<OSSMSSubscriptionObserver>*)observer;
NS_ASSUME_NONNULL_END

#pragma mark Email
Expand All @@ -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
Expand Down
Binary file not shown.
Loading