Skip to content

Commit

Permalink
major release 3 beta cut 3
Browse files Browse the repository at this point in the history
  • Loading branch information
emawby committed Oct 28, 2020
1 parent 41e3900 commit 5cc15ef
Show file tree
Hide file tree
Showing 15 changed files with 555 additions and 691 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<OSPermissionObserver>*)observer;
+ (void)removePermissionObserver:(NSObject<OSPermissionObserver>*)observer;
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-armv7_armv7s_arm64</string>
<string>ios-x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>OneSignal.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>armv7</string>
<string>armv7s</string>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
Expand All @@ -35,17 +35,17 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-maccatalyst</string>
<string>ios-armv7_armv7s_arm64</string>
<key>LibraryPath</key>
<string>OneSignal.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>armv7</string>
<string>armv7s</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Loading

0 comments on commit 5cc15ef

Please sign in to comment.