Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
69edbce
In App Messaging Initial Commit
Nightsd01 Oct 31, 2018
4aa2e48
Add Model Tests
Nightsd01 Oct 31, 2018
2e6bb4b
JS In-App Message Actions
Nightsd01 Nov 1, 2018
7740244
Remove JSON Data
Nightsd01 Nov 1, 2018
a808a83
Improved Layout Constraints
Nightsd01 Nov 6, 2018
1bfd0a8
Add Support for Triggers
Nightsd01 Nov 6, 2018
16f8273
Invalid Operator Test
Nightsd01 Nov 6, 2018
6b3696f
Rename Trigger Controller
Nightsd01 Nov 6, 2018
4e5b813
Rename Protocol Method
Nightsd01 Nov 6, 2018
1f8e148
Add Contains Operator
Nightsd01 Nov 7, 2018
0385227
Add Macros
Nightsd01 Nov 7, 2018
8e5c209
Fix Compiler Optimization Level
Nightsd01 Nov 8, 2018
bc39fd7
Add Dynamic Triggers
Nightsd01 Nov 8, 2018
cf4ec19
Fix Dynamic Triggers
Nightsd01 Nov 8, 2018
aaee713
Fix Logic Error
Nightsd01 Nov 8, 2018
f0f8564
Add Max Display Time
Nightsd01 Nov 8, 2018
f76693b
Implement Message Display Queue
Nightsd01 Nov 8, 2018
1456e83
Reset Session Launch Time in Tests
Nightsd01 Nov 8, 2018
a496701
Add SDK Version Check Test
Nightsd01 Nov 8, 2018
056a7ef
Stop Timers
Nightsd01 Nov 8, 2018
b4ab351
Add Integration Tests
Nightsd01 Nov 8, 2018
968fc89
Fix Swizzle
Nightsd01 Nov 9, 2018
adb78d2
Add More Integration Tests
Nightsd01 Nov 9, 2018
bfa6702
Add Integration Test
Nightsd01 Nov 9, 2018
c5d45ca
Add Not Equal To Operator
Nightsd01 Nov 9, 2018
1847c07
Add Device Type Trigger Support
Nightsd01 Nov 10, 2018
2618305
Fix Commit
Nightsd01 Nov 10, 2018
6936e4a
Add NotExists Operator
Nightsd01 Nov 10, 2018
04b0437
Fix Test Timer
Nightsd01 Nov 14, 2018
15589f9
Reset Test State
Nightsd01 Nov 14, 2018
d3b3fc3
Add JSON Representation to Message & Trigger Classes
Nightsd01 Nov 14, 2018
a5fe6ac
Fix Floating Point Error
Nightsd01 Nov 14, 2018
5af0397
Add Integration Test
Nightsd01 Nov 14, 2018
03f1185
Publicly Expose Trigger Methods
Nightsd01 Nov 14, 2018
32aaa83
Fix Example Demo
Nightsd01 Nov 14, 2018
e2c6c59
Add Trigger Identifiers
Nightsd01 Nov 15, 2018
5eb965c
Simplify Test
Nightsd01 Nov 15, 2018
748a770
Use Macro instead of C functions
Nightsd01 Nov 15, 2018
7a61498
Remove Blur Effect
Nightsd01 Nov 15, 2018
0a0398a
Add Max Width Constraint
Nightsd01 Nov 15, 2018
63a6312
Remove Height Observer
Nightsd01 Nov 15, 2018
b34cbce
Add Viewed/Opened API Calls
Nightsd01 Nov 16, 2018
65281ed
Fix Flaky Integration Test
Nightsd01 Nov 16, 2018
d99162a
Add Integration Test
Nightsd01 Nov 16, 2018
5e697d7
Change Endpoint Path
Nightsd01 Nov 16, 2018
d1b8c0e
Fix Flaky Integration Test
Nightsd01 Nov 17, 2018
d1ddba0
Implement Max Display Time Timer
Nightsd01 Nov 19, 2018
fa41052
iOS 11 Safe Area
Nightsd01 Nov 19, 2018
3314b96
Remove SDK Version Trigger
Nightsd01 Nov 20, 2018
03eead8
Add getTriggers Public Methods
Nightsd01 Nov 21, 2018
e7cfb35
Add Nullability Annotations
Nightsd01 Nov 21, 2018
ce18c8a
Fix Nullability Generics
Nightsd01 Nov 21, 2018
e6ff2fb
Fix Logic Error
Nightsd01 Nov 27, 2018
87f43c7
Add & Simplify Tests
Nightsd01 Nov 27, 2018
a0efb3b
Fix Trigger Evaluation Order Issue
Nightsd01 Nov 27, 2018
a8a16ff
Change Operator String Values
Nightsd01 Nov 27, 2018
5063e71
Add Trigger ID's
Nightsd01 Nov 28, 2018
4f3637a
Add Message Action
Nightsd01 Nov 30, 2018
89eb8ce
Trigger ID Assertion
Nightsd01 Nov 30, 2018
5a3b68f
Add Exact Time Trigger Tests
Nightsd01 Nov 30, 2018
4b118c7
Improve Tests
Nightsd01 Nov 30, 2018
79acf49
Message Actions
Nightsd01 Dec 1, 2018
0825e08
Fix PBXProj
Nightsd01 Dec 1, 2018
411ccd5
Message View Limit
Nightsd01 Dec 1, 2018
346acb7
Add Action Metadata
Nightsd01 Dec 3, 2018
970fa4b
Adjust Project Structure
Nightsd01 Dec 3, 2018
9e6d7f6
Fix Flaky Email Test
Nightsd01 Dec 3, 2018
871f5a1
Simplify Trigger Logic
Nightsd01 Dec 13, 2018
52dba4b
Fix Demo
Nightsd01 Dec 13, 2018
8f5ee01
URL Change
Nightsd01 Dec 14, 2018
d92f461
Fix Tests
Nightsd01 Dec 14, 2018
e92af0f
Merge branch 'in_app_messaging' into api_events
Nightsd01 Dec 14, 2018
257f0b5
Merge pull request #2 from Hiptic/api_events
Nightsd01 Dec 14, 2018
a163c0c
Fix Action Delegate Method
Nightsd01 Dec 14, 2018
4fcb56f
Change Property Name
Nightsd01 Dec 14, 2018
27b3277
Add Variant ID
Nightsd01 Dec 14, 2018
3020233
Data-Based HTTP Requests
Nightsd01 Dec 14, 2018
b5ec637
Add OSInAppMessageController
Nightsd01 Dec 14, 2018
40aa794
Load Message Content
Nightsd01 Dec 15, 2018
a1eebb6
Change Analytics Requests
Nightsd01 Jan 7, 2019
d2ed697
Fix Missing Import
Nightsd01 Jan 7, 2019
8220419
Add Ability to Disable In-App Messages
Nightsd01 Jan 8, 2019
abc5730
Merge pull request #3 from Hiptic/add_variant_id
Nightsd01 Jan 8, 2019
c1fe0a6
Merge branch 'in_app_messaging' into in_app_messaging_disable
Nightsd01 Jan 15, 2019
67ee638
Merge pull request #4 from Hiptic/in_app_messaging_disable
Nightsd01 Jan 16, 2019
c1fc96e
Full Screen Vertical Constraint
Nightsd01 Jan 16, 2019
9af122a
Fix ISO Language Code Issue
Nightsd01 Jan 16, 2019
ff6a5db
Fix Retain Cycle
Nightsd01 Jan 16, 2019
a3d4fef
Static Analysis Tweaks
Nightsd01 Jan 17, 2019
16888a4
Tablet Support
Nightsd01 Jan 17, 2019
4fa9a9e
JS IAM Bridge
Nightsd01 Jan 19, 2019
27e060c
Preventing pinch zoom
jkasten2 Jan 25, 2019
d02e3bc
action_id to id since it is nested in action
jkasten2 Jan 25, 2019
59389c0
Now used the rendering_complete event to display
jkasten2 Jan 25, 2019
2edbd46
Misc clean up and changing test values.
jkasten2 Jan 25, 2019
bbc9330
Cleaned up display type and fixed IAM height
jkasten2 May 21, 2019
01cfcfb
Fixed up unit tests
jkasten2 May 22, 2019
fbb7268
Updated REST calls for impressions and clicks
jkasten2 May 22, 2019
cea4d09
Added UI to change app id for testing
jkasten2 May 23, 2019
670b998
Fixed crash when tapping on message "X"
jkasten2 May 23, 2019
41bc92f
Added SDK-Version HTTP header required for IAMs
jkasten2 Aug 6, 2019
70353ad
Merge pull request #8 from OneSignal/iam_required_http_header
jkasten2 Aug 6, 2019
49dc7c1
Add IAM Preview
Jeasmine Aug 9, 2019
e4b4e76
Interface changes to IAMs from previous work done already
mikechoch Aug 13, 2019
508bbd9
Merge branch 'js_bridge_iam' into js_bridge_iam_preview_test
mikechoch Aug 13, 2019
acdef00
Removed clip bounds on IAM view on accident
mikechoch Aug 13, 2019
2ecc0d8
Merge branch 'js_bridge_iam' into js_bridge_iam_preview_test
mikechoch Aug 13, 2019
4ced8cb
Interface changes to IAMs from previous work done already (#13)
mikechoch Aug 13, 2019
af15314
Add IAM Preview (#11)
Jeasmine Aug 13, 2019
236a42a
Merge branch 'js_bridge' of github.com:OneSignal/OneSignal-iOS-SDK-pr…
mikechoch Aug 13, 2019
a265536
Fix IAM loading html blocking the user input (#12)
Jeasmine Aug 14, 2019
af09d8b
Make sure dismiss animation works when showing new IAM preview (#14)
mikechoch Aug 14, 2019
fef5853
Modified OSInAppMessage and add extra handling when showing IAM previ…
mikechoch Aug 16, 2019
cea35e5
Commit to fix iPhone X UI issues with IAM (#16)
mikechoch Aug 19, 2019
01f69c8
Add apns preview parse (#17)
Jeasmine Aug 23, 2019
bc45841
IAM dash stats (impressions and clicks), show IAM once, and js height…
mikechoch Aug 26, 2019
e4906eb
Custom triggers (#19)
Jeasmine Aug 26, 2019
a95e837
Squashed and merged dynamic triggers into this branch and now needs t…
mikechoch Aug 27, 2019
2777294
Making sure pausing IAM and click action handler are implemented (#21)
mikechoch Aug 27, 2019
dab790d
Iam merge issue fixes after triggers (#23)
mikechoch Aug 27, 2019
b471189
Added some new UI fields for IAM public methods to tests (#24)
mikechoch Aug 27, 2019
8e60ea7
Minor refactoring after merging (#26)
mikechoch Aug 29, 2019
6313b87
Fix tests on Dynamic triggers
Jeasmine Sep 3, 2019
e558255
Merge pull request #28 from OneSignal/fix/iam-trigger-test
jkasten2 Sep 3, 2019
7420082
Added dismiss duration handling for IAMs (#27)
mikechoch Sep 3, 2019
0d34c27
Merge from master version 021001 (#25)
jkasten2 Sep 5, 2019
86c9529
Updated frameworks and version number (#31)
mikechoch Sep 5, 2019
fe45e6f
Merge branch 'js_bridge_private_to_public' into merge_021100_into_master
mikechoch Sep 6, 2019
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
10 changes: 5 additions & 5 deletions OneSignal.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Pod::Spec.new do |s|
s.name = "OneSignal"
s.version = "2.10.2"
s.version = "2.11.0"
s.summary = "OneSignal push notification library for mobile apps."
s.homepage = "https://onesignal.com"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Joseph Kalash" => "joseph@onesignal.com", "Josh Kasten" => "josh@onesignal.com" , "Brad Hesse" => "brad@onesignal.com"}

s.source = { :git => "https://github.com/OneSignal/OneSignal-iOS-SDK.git", :tag => s.version.to_s }

s.platform = :ios
s.requires_arc = true

s.ios.vendored_frameworks = 'iOS_SDK/OneSignalSDK/Framework/OneSignal.framework'
s.framework = 'SystemConfiguration', 'UIKit', 'UserNotifications', 'WebKit'
s.framework = 'SystemConfiguration', 'UIKit', 'UserNotifications', 'WebKit', 'CoreGraphics'
end
11 changes: 6 additions & 5 deletions OneSignalDynamic.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Pod::Spec.new do |s|
s.name = "OneSignalDynamic"
s.version = "2.10.2"
s.version = "2.11.0"
s.summary = "OneSignal push notification library for mobile apps."
s.homepage = "https://onesignal.com"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Joseph Kalash" => "joseph@onesignal.com", "Josh Kasten" => "josh@onesignal.com" , "Brad Hesse" => "brad@onesignal.com"}

s.source = { :git => "https://github.com/OneSignal/OneSignal-iOS-SDK.git", :tag => s.version.to_s }

s.platform = :ios, "8.0"
s.requires_arc = true

s.ios.vendored_frameworks = 'iOS_SDK/OneSignalSDK/Framework/Dynamic/OneSignal.framework'
s.framework = 'SystemConfiguration', 'UIKit', 'UserNotifications', 'WebKit'
s.framework = 'SystemConfiguration', 'UIKit', 'UserNotifications', 'WebKit', 'CoreGraphics'
end

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

/* Begin PBXBuildFile section */
03432CDC1EBD426A0071FC48 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03432CDB1EBD426A0071FC48 /* CoreLocation.framework */; };
03FA99F7231EEEC90003405A /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03FA99F6231EEEC90003405A /* WebKit.framework */; };
03FA99F8231EEF090003405A /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03FA99F6231EEEC90003405A /* WebKit.framework */; };
4529DECC1FA7EAB800CEAB1D /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91B6EA051E83215000B5CF01 /* UserNotifications.framework */; };
4529DEFA1FA91FBF00CEAB1D /* FirebaseAnalytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4529DEF91FA91FBF00CEAB1D /* FirebaseAnalytics.framework */; };
4529DEFC1FA9201200CEAB1D /* FirebaseCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4529DEFB1FA9201000CEAB1D /* FirebaseCore.framework */; };
Expand Down Expand Up @@ -41,6 +39,8 @@
91B6EA081E8321B400B5CF01 /* libOneSignal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9112E8A31E724DCB0022A1CB /* libOneSignal.a */; };
91B6EA0A1E834B1700B5CF01 /* sentImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 91B6EA091E834B1700B5CF01 /* sentImage.jpg */; };
91B6EA0C1E834BD800B5CF01 /* sentImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 91B6EA091E834B1700B5CF01 /* sentImage.jpg */; };
CACBAAB6218A7136000ACAA5 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACBAAB5218A7136000ACAA5 /* WebKit.framework */; };
CACBAAB7218A713C000ACAA5 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACBAAB5218A7136000ACAA5 /* WebKit.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -69,7 +69,6 @@

/* Begin PBXFileReference section */
03432CDB1EBD426A0071FC48 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
03FA99F6231EEEC90003405A /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
4529DEF91FA91FBF00CEAB1D /* FirebaseAnalytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FirebaseAnalytics.framework; sourceTree = "<group>"; };
4529DEFB1FA9201000CEAB1D /* FirebaseCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FirebaseCore.framework; sourceTree = "<group>"; };
4529DEFD1FA921D900CEAB1D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -99,14 +98,15 @@
9150E7821E73BFB600C5D46A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
91B6EA051E83215000B5CF01 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
91B6EA091E834B1700B5CF01 /* sentImage.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sentImage.jpg; sourceTree = "<group>"; };
CACBAAB5218A7136000ACAA5 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
9112E87F1E724C320022A1CB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
03FA99F8231EEF090003405A /* WebKit.framework in Frameworks */,
CACBAAB6218A7136000ACAA5 /* WebKit.framework in Frameworks */,
4529DF041FA929F800CEAB1D /* FirebaseNanoPB.framework in Frameworks */,
9112E8A51E724ECC0022A1CB /* libOneSignal.a in Frameworks */,
03432CDC1EBD426A0071FC48 /* CoreLocation.framework in Frameworks */,
Expand All @@ -124,13 +124,13 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CACBAAB7218A713C000ACAA5 /* WebKit.framework in Frameworks */,
454EB3281FABEF3E0093AD9B /* FirebaseAnalytics.framework in Frameworks */,
454EB3271FABEF3A0093AD9B /* FirebaseCore.framework in Frameworks */,
454EB3261FABEF380093AD9B /* FirebaseInstanceID.framework in Frameworks */,
454EB3251FABEF350093AD9B /* nanopb.framework in Frameworks */,
454EB3241FABEF320093AD9B /* FirebaseNanoPB.framework in Frameworks */,
454EB3231FABEF2F0093AD9B /* GoogleToolboxForMac.framework in Frameworks */,
03FA99F7231EEEC90003405A /* WebKit.framework in Frameworks */,
91B6EA081E8321B400B5CF01 /* libOneSignal.a in Frameworks */,
91B6EA071E83215800B5CF01 /* UIKit.framework in Frameworks */,
91B6EA061E83215000B5CF01 /* UserNotifications.framework in Frameworks */,
Expand Down Expand Up @@ -190,7 +190,7 @@
9112E8A21E724DCA0022A1CB /* Frameworks */ = {
isa = PBXGroup;
children = (
03FA99F6231EEEC90003405A /* WebKit.framework */,
CACBAAB5218A7136000ACAA5 /* WebKit.framework */,
4529DF051FA92C7F00CEAB1D /* GoogleToolboxForMac.framework */,
4529DF031FA929F700CEAB1D /* FirebaseNanoPB.framework */,
4529DF011FA9292800CEAB1D /* nanopb.framework */,
Expand Down Expand Up @@ -304,6 +304,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -494,6 +495,7 @@
INFOPLIST_FILE = OneSignalDevApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand Down
4 changes: 3 additions & 1 deletion iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
#import <UIKit/UIKit.h>
#import <OneSignal/OneSignal.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate, OSPermissionObserver, OSSubscriptionObserver, OSEmailSubscriptionObserver, OSNotificationDisplayTypeDelegate>
@interface AppDelegate : UIResponder <UIApplicationDelegate, OSPermissionObserver, OSSubscriptionObserver, OSEmailSubscriptionObserver>

@property (strong, nonatomic) UIWindow *window;

+ (NSString*)getOneSignalAppId;
+ (void) setOneSignalAppId:(NSString*)onesignalAppId;

@end

60 changes: 37 additions & 23 deletions iOS_SDK/OneSignalDevApp/OneSignalDevApp/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

[FIRApp configure];
// [FIRApp configure];

NSLog(@"Bundle URL: %@", [[NSBundle mainBundle] bundleURL]);

[OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_ERROR];
[OneSignal setLogLevel:ONE_S_LL_VERBOSE visualLevel:ONE_S_LL_NONE];

OneSignal.inFocusDisplayType = OSNotificationDisplayTypeInAppAlert;

Expand All @@ -52,38 +52,62 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Notifiation Opened" message:@"Notification Opened" delegate:self cancelButtonTitle:@"Delete" otherButtonTitles:@"Cancel", nil];
[alert show];
};


[OneSignal setSubscription:true];



id notificationReceiverBlock = ^(OSNotification *notification) {
NSLog(@"Received Notification - %@", notification.payload.notificationID);
};

// Example block for IAM action click handler
id inAppMessagingActionClickBlock = ^(OSInAppMessageAction *action) {
NSString *message = [NSString stringWithFormat:@"Click Action Occurred: clickName:%@ clickUrl:%@ firstClick:%i closesMessage:%i",
action.clickName,
action.clickUrl,
action.firstClick,
action.closesMessage];
[OneSignal onesignal_Log:ONE_S_LL_DEBUG message:message];
};

[OneSignal setSubscription:true];

// Example setter for IAM action click handler using OneSignal public method
[OneSignal setInAppMessageClickHandler:inAppMessagingActionClickBlock];

[OneSignal initWithLaunchOptions:launchOptions
appId:@"5dc0b8c7-335a-4c4c-9ed4-266cbf2158ac"
appId:[AppDelegate getOneSignalAppId]
handleNotificationReceived:notificationReceiverBlock
handleNotificationAction:openNotificationHandler
settings:@{kOSSettingsKeyAutoPrompt: @false,
kOSSettingsKeyInAppLaunchURL: @true}];

[OneSignal promptLocation];
[OneSignal sendTag:@"someKey1122" value:@"03222017"];

OneSignal.inFocusDisplayType = OSNotificationDisplayTypeNotification;


[OneSignal addPermissionObserver:self];
[OneSignal addSubscriptionObserver:self];
[OneSignal addEmailSubscriptionObserver:self];

[OneSignal setNotificationDisplayTypeDelegate:self];
[OneSignal pauseInAppMessages:false];

NSLog(@"UNUserNotificationCenter.delegate: %@", UNUserNotificationCenter.currentNotificationCenter.delegate);

return YES;
}

#define ONESIGNAL_APP_ID_KEY_FOR_TESTING @"ONESIGNAL_APP_ID_KEY_FOR_TESTING"

+ (NSString*)getOneSignalAppId {
NSString* onesignalAppId = [[NSUserDefaults standardUserDefaults] objectForKey:ONESIGNAL_APP_ID_KEY_FOR_TESTING];
if (!onesignalAppId)
onesignalAppId = @"77e32082-ea27-42e3-a898-c72e141824ef";

return onesignalAppId;
}

+ (void) setOneSignalAppId:(NSString*)onesignalAppId {
[[NSUserDefaults standardUserDefaults] setObject:onesignalAppId forKey:ONESIGNAL_APP_ID_KEY_FOR_TESTING];
[[NSUserDefaults standardUserDefaults] synchronize];
}

- (void) onOSSubscriptionChanged:(OSSubscriptionStateChanges*)stateChanges {
NSLog(@"onOSSubscriptionChanged: %@", stateChanges);
NSLog(@"HERE");
Expand All @@ -99,16 +123,6 @@ -(void)onOSEmailSubscriptionChanged:(OSEmailSubscriptionStateChanges *)stateChan

}

- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload
withCompletion:(OSNotificationDisplayTypeResponse)completion {
if (payload.additionalData[@"overrideDisplayType"]) {
OSNotificationDisplayType newType = (OSNotificationDisplayType)[payload.additionalData[@"overrideDisplayType"] intValue];

completion(newType);
}
}


- (void)applicationWillResignActive:(UIApplication *)application {
}

Expand Down
Loading