com.onesignal.unity.ios 5.2.1 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,6 +127,8 @@ namespace OneSignalSDK.iOS
127
127
 
128
128
  DisableBitcode();
129
129
 
130
+ AddLocationUsageDescription();
131
+
130
132
  // Save the project back out
131
133
  File.WriteAllText(_projectPath, _project.WriteToString());
132
134
  }
@@ -219,11 +221,10 @@ namespace OneSignalSDK.iOS
219
221
 
220
222
  ExtensionAddSourceFiles(extensionGuid);
221
223
 
222
- // Makes it so that the extension target is Universal (not just iPhone) and has an iOS 10 deployment target
224
+ // Makes it so that the extension target is Universal (not just iPhone)
223
225
  _project.SetBuildProperty(extensionGuid, "TARGETED_DEVICE_FAMILY", "1,2");
224
- _project.SetBuildProperty(extensionGuid, "IPHONEOS_DEPLOYMENT_TARGET", "10.0");
226
+ _project.SetBuildProperty(extensionGuid, "IPHONEOS_DEPLOYMENT_TARGET", "11.0");
225
227
  _project.SetBuildProperty(extensionGuid, "SWIFT_VERSION", "5.0");
226
- _project.SetBuildProperty(extensionGuid, "ARCHS", "arm64");
227
228
  _project.SetBuildProperty(
228
229
  extensionGuid,
229
230
  "DEVELOPMENT_TEAM",
@@ -357,6 +358,19 @@ namespace OneSignalSDK.iOS
357
358
  File.WriteAllText(podfilePath, podfile);
358
359
  }
359
360
 
361
+ private void AddLocationUsageDescription()
362
+ {
363
+ var plistPath = Path.Combine(_outputPath, "Info.plist");
364
+ var plist = new PlistDocument();
365
+ plist.ReadFromFile(plistPath);
366
+
367
+ const string key = "NSLocationWhenInUseUsageDescription";
368
+ if (plist.root[key] == null)
369
+ plist.root.SetString(key, "Your location is used to send relevant content.");
370
+
371
+ plist.WriteToFile(plistPath);
372
+ }
373
+
360
374
  private void DisableBitcode()
361
375
  {
362
376
  // Main
@@ -1,5 +1,5 @@
1
1
  <dependencies>
2
2
  <iosPods>
3
- <iosPod name="OneSignalXCFramework" version="5.4.1" addToAllTargets="true" />
3
+ <iosPod name="OneSignalXCFramework" version="5.4.2" addToAllTargets="true" />
4
4
  </iosPods>
5
5
  </dependencies>
@@ -1,25 +1,25 @@
1
1
  import UserNotifications
2
- import OneSignalFramework
2
+ import OneSignalExtension
3
3
 
4
4
  class NotificationService: UNNotificationServiceExtension {
5
5
  var contentHandler: ((UNNotificationContent) -> Void)?
6
6
  var receivedRequest: UNNotificationRequest!
7
7
  var bestAttemptContent: UNMutableNotificationContent?
8
-
8
+
9
9
  override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
10
10
  self.receivedRequest = request
11
11
  self.contentHandler = contentHandler
12
12
  self.bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
13
-
13
+
14
14
  if let bestAttemptContent = bestAttemptContent {
15
- OneSignal.didReceiveNotificationExtensionRequest(self.receivedRequest, with: bestAttemptContent, withContentHandler: self.contentHandler)
15
+ OneSignalExtension.didReceiveNotificationExtensionRequest(self.receivedRequest, with: bestAttemptContent, withContentHandler: self.contentHandler)
16
16
  }
17
17
  }
18
-
18
+
19
19
  override func serviceExtensionTimeWillExpire() {
20
- if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
21
- OneSignal.serviceExtensionTimeWillExpireRequest(self.receivedRequest, with: self.bestAttemptContent)
20
+ if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
21
+ OneSignalExtension.serviceExtensionTimeWillExpireRequest(self.receivedRequest, with: self.bestAttemptContent)
22
22
  contentHandler(bestAttemptContent)
23
23
  }
24
- }
24
+ }
25
25
  }
@@ -97,7 +97,7 @@ static bool swizzled = false;
97
97
 
98
98
  - (BOOL)oneSignalApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
99
99
  [OneSignalWrapper setSdkType:@"unity"];
100
- [OneSignalWrapper setSdkVersion:@"050201"];
100
+ [OneSignalWrapper setSdkVersion:@"050202"];
101
101
  [OneSignal initialize:nil withLaunchOptions:launchOptions];
102
102
 
103
103
  if ([self respondsToSelector:@selector(oneSignalApplication:didFinishLaunchingWithOptions:)])
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "com.onesignal.unity.ios",
3
3
  "displayName": "OneSignal Unity SDK - iOS",
4
- "version": "5.2.1",
4
+ "version": "5.2.2",
5
5
  "unity": "2018.4",
6
6
  "description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
7
7
  "dependencies": {
8
- "com.onesignal.unity.core": "5.2.1"
8
+ "com.onesignal.unity.core": "5.2.2"
9
9
  },
10
10
  "keywords": [
11
11
  "push-notifications",