com.onesignal.unity.ios 2.14.3

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.
Files changed (35) hide show
  1. package/Documentation~/com.onesignal.unity.ios.md +4 -0
  2. package/Editor/OneSignal.iOS.Editor.asmdef +14 -0
  3. package/Editor/OneSignal.iOS.Editor.asmdef.meta +7 -0
  4. package/Editor/PostProcessBuildPlayer_iOS.cs +399 -0
  5. package/Editor/PostProcessBuildPlayer_iOS.cs.meta +13 -0
  6. package/Editor.meta +8 -0
  7. package/LICENSE.md +129 -0
  8. package/LICENSE.md.meta +7 -0
  9. package/README.md +5 -0
  10. package/README.md.meta +7 -0
  11. package/Runtime/AssemblyInfo.cs +3 -0
  12. package/Runtime/AssemblyInfo.cs.meta +11 -0
  13. package/Runtime/OneSignal.iOS.asmdef +17 -0
  14. package/Runtime/OneSignal.iOS.asmdef.meta +7 -0
  15. package/Runtime/OneSignalIOS.cs +458 -0
  16. package/Runtime/OneSignalIOS.cs.meta +10 -0
  17. package/Runtime/OneSignalIOSInit.cs +12 -0
  18. package/Runtime/OneSignalIOSInit.cs.meta +3 -0
  19. package/Runtime/Plugins/iOS/Info.plist +31 -0
  20. package/Runtime/Plugins/iOS/Info.plist.meta +9 -0
  21. package/Runtime/Plugins/iOS/NotificationService.h +13 -0
  22. package/Runtime/Plugins/iOS/NotificationService.h.meta +26 -0
  23. package/Runtime/Plugins/iOS/NotificationService.m +40 -0
  24. package/Runtime/Plugins/iOS/NotificationService.m.meta +36 -0
  25. package/Runtime/Plugins/iOS/OneSignal.h +617 -0
  26. package/Runtime/Plugins/iOS/OneSignal.h.meta +26 -0
  27. package/Runtime/Plugins/iOS/OneSignalUnityRuntime.m +542 -0
  28. package/Runtime/Plugins/iOS/OneSignalUnityRuntime.m.meta +24 -0
  29. package/Runtime/Plugins/iOS/libOneSignal.a +0 -0
  30. package/Runtime/Plugins/iOS/libOneSignal.a.meta +21 -0
  31. package/Runtime/Plugins/iOS.meta +9 -0
  32. package/Runtime/Plugins.meta +8 -0
  33. package/Runtime.meta +8 -0
  34. package/package.json +35 -0
  35. package/package.json.meta +7 -0
package/LICENSE.md ADDED
@@ -0,0 +1,129 @@
1
+ Modified MIT License
2
+
3
+ Copyright 2020 OneSignal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ 1. The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ 2. All copies of substantial portions of the Software may only be used in connection
16
+ with services provided by OneSignal.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
25
+
26
+
27
+ Includes portions from the Google GcmClient demo project:
28
+ Copyright 2013 Google Inc.
29
+
30
+ Licensed under the Apache License, Version 2.0 (the "License");
31
+ you may not use this file except in compliance with the License.
32
+ You may obtain a copy of the License at
33
+
34
+ http://www.apache.org/licenses/LICENSE-2.0
35
+
36
+ Unless required by applicable law or agreed to in writing, software
37
+ distributed under the License is distributed on an "AS IS" BASIS,
38
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
+ See the License for the specific language governing permissions and
40
+ limitations under the License.
41
+
42
+ Includes portions from RootTools:
43
+ Copyright (c) 2012 Stephen Erickson, Chris Ravenscroft, Dominik Schuermann, Adam Shanks
44
+
45
+ This code is dual-licensed under the terms of the Apache License Version 2.0 and
46
+ the terms of the General Public License (GPL) Version 2.
47
+ You may use this code according to either of these licenses as is most appropriate
48
+ for your project on a case-by-case basis.
49
+
50
+ The terms of each license can be found at:
51
+
52
+ * http://www.apache.org/licenses/LICENSE-2.0
53
+ * http://www.gnu.org/licenses/gpl-2.0.txt
54
+
55
+ Unless required by applicable law or agreed to in writing, software
56
+ distributed under these Licenses is distributed on an "AS IS" BASIS,
57
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
58
+ See each License for the specific language governing permissions and
59
+ limitations under that License.
60
+
61
+ Includes portions from DTTJailbreakDetection:
62
+ The MIT License (MIT)
63
+
64
+ Copyright (c) 2014 Doan Truong Thi
65
+
66
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
67
+ this software and associated documentation files (the "Software"), to deal in
68
+ the Software without restriction, including without limitation the rights to
69
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
70
+ the Software, and to permit persons to whom the Software is furnished to do so,
71
+ subject to the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be included in all
74
+ copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
77
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
78
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
79
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
80
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
81
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
82
+
83
+ Includes portions from BSMobileProvision:
84
+ Copyright (c) 2013, The Blindsight Corporation
85
+ All rights reserved.
86
+
87
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
88
+
89
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
90
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
91
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
92
+
93
+ Includes ShortcutBadger:
94
+ Unless required by applicable law or agreed to in writing, software
95
+ distributed under these Licenses is distributed on an "AS IS" BASIS,
96
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97
+ See each License for the specific language governing permissions and
98
+ limitations under that License.
99
+
100
+
101
+ Copyright 2014 Leo Lin
102
+
103
+ Licensed under the Apache License, Version 2.0 (the "License");
104
+ you may not use this file except in compliance with the License.
105
+ You may obtain a copy of the License at
106
+
107
+ http://www.apache.org/licenses/LICENSE-2.0
108
+
109
+ Unless required by applicable law or agreed to in writing, software
110
+ distributed under the License is distributed on an "AS IS" BASIS,
111
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112
+ See the License for the specific language governing permissions and
113
+ limitations under the License.
114
+
115
+
116
+ Includes unity-jar-resolver
117
+ Copyright (C) 2014 Google Inc.
118
+
119
+ Licensed under the Apache License, Version 2.0 (the "License");
120
+ you may not use this file except in compliance with the License.
121
+ You may obtain a copy of the License at
122
+
123
+ http://www.apache.org/licenses/LICENSE-2.0
124
+
125
+ Unless required by applicable law or agreed to in writing, software
126
+ distributed under the License is distributed on an "AS IS" BASIS,
127
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
128
+ See the License for the specific language governing permissions and
129
+ limitations under the License.
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: bfaf5352a226847cf966fa91177eae88
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # OneSignal Unity SDK - iOS
2
+ Check out the [README](https://github.com/OneSignal/OneSignal-Unity-SDK/README.md) in our GitHub repository.
3
+
4
+ Full documentation available at [documentation.onesignal.com](https://documentation.onesignal.com/docs/unity-sdk-setup)
5
+
package/README.md.meta ADDED
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: a56f0ded622ac47b2a7c0bc31b090897
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,3 @@
1
+ using UnityEngine.Scripting;
2
+
3
+ [assembly: AlwaysLinkAssembly]
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 59d02f57a069a4cf696ddefc94eab5d6
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "OneSignal.iOS",
3
+ "references": [
4
+ "OneSignal.Core"
5
+ ],
6
+ "optionalUnityReferences": [],
7
+ "includePlatforms": [
8
+ "Editor",
9
+ "iOS"
10
+ ],
11
+ "excludePlatforms": [],
12
+ "allowUnsafeCode": false,
13
+ "overrideReferences": false,
14
+ "precompiledReferences": [],
15
+ "autoReferenced": false,
16
+ "defineConstraints": []
17
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: ba91cb80af27944c8a371b0ab73f7aa6
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,458 @@
1
+ /*
2
+ * Modified MIT License
3
+ *
4
+ * Copyright 2017 OneSignal
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * 1. The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * 2. All copies of substantial portions of the Software may only be used in connection
17
+ * with services provided by OneSignal.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ */
27
+
28
+ using System.Runtime.InteropServices;
29
+ using System.Collections.Generic;
30
+ using System;
31
+
32
+ class OneSignalIOS : IOneSignalPlatform
33
+ {
34
+ [DllImport("__Internal")]
35
+ public static extern void _init(string listenerName, string appId, bool autoPrompt, bool inAppLaunchUrLs,
36
+ int displayOption, int logLevel, int visualLogLevel, bool requiresUserPrivacyConsent);
37
+
38
+ [DllImport("__Internal")]
39
+ public static extern void _registerForPushNotifications();
40
+
41
+ [DllImport("__Internal")]
42
+ public static extern void _sendTag(string tagName, string tagValue);
43
+
44
+ [DllImport("__Internal")]
45
+ public static extern void _sendTags(string tags);
46
+
47
+ [DllImport("__Internal")]
48
+ public static extern void _getTags(string delegateId);
49
+
50
+ [DllImport("__Internal")]
51
+ public static extern void _deleteTag(string key);
52
+
53
+ [DllImport("__Internal")]
54
+ public static extern void _deleteTags(string keys);
55
+
56
+ [DllImport("__Internal")]
57
+ public static extern void _idsAvailable(string delegateId);
58
+
59
+ [DllImport("__Internal")]
60
+ public static extern void _setSubscription(bool enable);
61
+
62
+ [DllImport("__Internal")]
63
+ public static extern void _postNotification(string delegateIdSuccess, string delegateIdFailure, string json);
64
+
65
+ [DllImport("__Internal")]
66
+ public static extern void _syncHashedEmail(string email);
67
+
68
+ [DllImport("__Internal")]
69
+ public static extern void _promptLocation();
70
+
71
+ [DllImport("__Internal")]
72
+ public static extern void _setInFocusDisplayType(int type);
73
+
74
+ [DllImport("__Internal")]
75
+ public static extern void _promptForPushNotificationsWithUserResponse();
76
+
77
+ [DllImport("__Internal")]
78
+ public static extern void _addPermissionObserver();
79
+
80
+ [DllImport("__Internal")]
81
+ public static extern void _removePermissionObserver();
82
+
83
+ [DllImport("__Internal")]
84
+ public static extern void _addSubscriptionObserver();
85
+
86
+ [DllImport("__Internal")]
87
+ public static extern void _removeSubscriptionObserver();
88
+
89
+ [DllImport("__Internal")]
90
+ public static extern void _addEmailSubscriptionObserver();
91
+
92
+ [DllImport("__Internal")]
93
+ public static extern void _removeEmailSubscriptionObserver();
94
+
95
+ [DllImport("__Internal")]
96
+ public static extern string _getPermissionSubscriptionState();
97
+
98
+ [DllImport("__Internal")]
99
+ public static extern void _setUnauthenticatedEmail(string delegateIdSuccess, string delegateIdFailure,
100
+ string email);
101
+
102
+ [DllImport("__Internal")]
103
+ public static extern void _setEmail(string delegateIdSuccess, string delegateIdFailure, string email,
104
+ string emailAuthCode);
105
+
106
+ [DllImport("__Internal")]
107
+ public static extern void _logoutEmail(string delegateIdSuccess, string delegateIdFailure);
108
+
109
+ [DllImport("__Internal")]
110
+ public static extern void _setOneSignalLogLevel(int logLevel, int visualLogLevel);
111
+
112
+ [DllImport("__Internal")]
113
+ public static extern void _userDidProvideConsent(bool consent);
114
+
115
+ [DllImport("__Internal")]
116
+ public static extern bool _userProvidedConsent();
117
+
118
+ [DllImport("__Internal")]
119
+ public static extern void _setRequiresUserPrivacyConsent(bool required);
120
+
121
+ [DllImport("__Internal")]
122
+ public static extern void _setLocationShared(bool enable);
123
+
124
+ [DllImport("__Internal")]
125
+ public static extern void _setExternalUserId(string delegateId, string externalId);
126
+
127
+ [DllImport("__Internal")]
128
+ public static extern void _setExternalUserIdWithAuthToken(string delegateId, string delegateIdFailure,
129
+ string externalId, string authHashToken);
130
+
131
+ [DllImport("__Internal")]
132
+ public static extern void _removeExternalUserId(string delegateId);
133
+
134
+ [DllImport("__Internal")]
135
+ public static extern void _addTriggers(string triggers);
136
+
137
+ [DllImport("__Internal")]
138
+ public static extern void _removeTriggerForKey(string key);
139
+
140
+ [DllImport("__Internal")]
141
+ public static extern void _removeTriggersForKeys(string keys);
142
+
143
+ [DllImport("__Internal")]
144
+ public static extern string _getTriggerValueForKey(string key);
145
+
146
+ [DllImport("__Internal")]
147
+ public static extern void _pauseInAppMessages(bool pause);
148
+
149
+ [DllImport("__Internal")]
150
+ public static extern void _sendOutcome(string delegateId, string name);
151
+
152
+ [DllImport("__Internal")]
153
+ public static extern void _sendUniqueOutcome(string delegateId, string name);
154
+
155
+ [DllImport("__Internal")]
156
+ public static extern void _sendOutcomeWithValue(string delegateId, string name, float value);
157
+
158
+ public void Init()
159
+ {
160
+ bool autoPrompt = true, inAppLaunchUrl = true;
161
+ if (OneSignal.builder.iOSSettings != null)
162
+ {
163
+ if (OneSignal.builder.iOSSettings.ContainsKey(OneSignal.kOSSettingsAutoPrompt))
164
+ autoPrompt = OneSignal.builder.iOSSettings[OneSignal.kOSSettingsAutoPrompt];
165
+ if (OneSignal.builder.iOSSettings.ContainsKey(OneSignal.kOSSettingsInAppLaunchURL))
166
+ inAppLaunchUrl = OneSignal.builder.iOSSettings[OneSignal.kOSSettingsInAppLaunchURL];
167
+ }
168
+
169
+ _init(OneSignal.GameObjectName, OneSignal.builder.appID,
170
+ autoPrompt, inAppLaunchUrl, (int) OneSignal.inFocusDisplayType,
171
+ (int) OneSignal.logLevel, (int) OneSignal.visualLogLevel, OneSignal.requiresUserConsent);
172
+ }
173
+
174
+ public void SetLocationShared(bool shared)
175
+ {
176
+ _setLocationShared(shared);
177
+ }
178
+
179
+ public void RegisterForPushNotifications()
180
+ {
181
+ _registerForPushNotifications();
182
+ }
183
+
184
+ public void SendTag(string tagName, string tagValue)
185
+ {
186
+ _sendTag(tagName, tagValue);
187
+ }
188
+
189
+ public void SendTags(IDictionary<string, string> tags)
190
+ {
191
+ _sendTags(Json.Serialize(tags));
192
+ }
193
+
194
+ public void GetTags(string delegateId)
195
+ {
196
+ _getTags(delegateId);
197
+ }
198
+
199
+ public void DeleteTag(string key)
200
+ {
201
+ _deleteTag(key);
202
+ }
203
+
204
+ public void DeleteTags(IList<string> keys)
205
+ {
206
+ _deleteTags(Json.Serialize(keys));
207
+ }
208
+
209
+ public void IdsAvailable(string delegateId)
210
+ {
211
+ _idsAvailable(delegateId);
212
+ }
213
+
214
+ public void SetSubscription(bool enable)
215
+ {
216
+ _setSubscription(enable);
217
+ }
218
+
219
+ public void PostNotification(string delegateIdSuccess, string delegateIdFailure,
220
+ Dictionary<string, object> data)
221
+ {
222
+ _postNotification(delegateIdSuccess, delegateIdFailure, Json.Serialize(data));
223
+ }
224
+
225
+ public void SyncHashedEmail(string email)
226
+ {
227
+ _syncHashedEmail(email);
228
+ }
229
+
230
+ public void PromptLocation()
231
+ {
232
+ _promptLocation();
233
+ }
234
+
235
+ public void SetLogLevel(OneSignal.LOG_LEVEL logLevel, OneSignal.LOG_LEVEL visualLevel)
236
+ {
237
+ _setOneSignalLogLevel((int) logLevel, (int) visualLevel);
238
+ }
239
+
240
+ public void SetInFocusDisplaying(OneSignal.OSInFocusDisplayOption display)
241
+ {
242
+ _setInFocusDisplayType((int) display);
243
+ }
244
+
245
+ public void PromptForPushNotificationsWithUserResponse()
246
+ {
247
+ _promptForPushNotificationsWithUserResponse();
248
+ }
249
+
250
+ public void AddPermissionObserver()
251
+ {
252
+ _addPermissionObserver();
253
+ }
254
+
255
+ public void RemovePermissionObserver()
256
+ {
257
+ _removePermissionObserver();
258
+ }
259
+
260
+ public void AddSubscriptionObserver()
261
+ {
262
+ _addSubscriptionObserver();
263
+ }
264
+
265
+ public void RemoveSubscriptionObserver()
266
+ {
267
+ _removeSubscriptionObserver();
268
+ }
269
+
270
+ public void AddEmailSubscriptionObserver()
271
+ {
272
+ _addEmailSubscriptionObserver();
273
+ }
274
+
275
+ public void RemoveEmailSubscriptionObserver()
276
+ {
277
+ _removeEmailSubscriptionObserver();
278
+ }
279
+
280
+ public void SetEmail(string delegateIdSuccess, string delegateIdFailure, string email)
281
+ {
282
+ _setUnauthenticatedEmail(delegateIdSuccess, delegateIdFailure, email);
283
+ }
284
+
285
+ public void SetEmail(string delegateIdSuccess, string delegateIdFailure, string email, string emailAuthCode)
286
+ {
287
+ _setEmail(delegateIdSuccess, delegateIdFailure, email, emailAuthCode);
288
+ }
289
+
290
+ public void LogoutEmail(string delegateIdSuccess, string delegateIdFailure)
291
+ {
292
+ _logoutEmail(delegateIdSuccess, delegateIdFailure);
293
+ }
294
+
295
+ public void UserDidProvideConsent(bool consent)
296
+ {
297
+ _userDidProvideConsent(consent);
298
+ }
299
+
300
+ public bool UserProvidedConsent()
301
+ {
302
+ return _userProvidedConsent();
303
+ }
304
+
305
+ public void SetRequiresUserPrivacyConsent(bool required)
306
+ {
307
+ _setRequiresUserPrivacyConsent(required);
308
+ }
309
+
310
+ public void SetExternalUserId(string delegateId, string externalId)
311
+ {
312
+ _setExternalUserId(delegateId, externalId);
313
+ }
314
+
315
+ public void SetExternalUserId(string delegateId, string delegateIdFailure, string externalId,
316
+ string externalIdAuthHash)
317
+ {
318
+ _setExternalUserIdWithAuthToken(delegateId, delegateIdFailure, externalId, externalIdAuthHash);
319
+ }
320
+
321
+ public void RemoveExternalUserId(string delegateId)
322
+ {
323
+ _removeExternalUserId(delegateId);
324
+ }
325
+
326
+ public void AddTrigger(string key, object value)
327
+ {
328
+ IDictionary<string, object> trigger = new Dictionary<string, object>() {{key, value}};
329
+ _addTriggers(Json.Serialize(trigger));
330
+ }
331
+
332
+ public void AddTriggers(IDictionary<string, object> triggers)
333
+ {
334
+ _addTriggers(Json.Serialize(triggers));
335
+ }
336
+
337
+ public void RemoveTriggerForKey(string key)
338
+ {
339
+ _removeTriggerForKey(key);
340
+ }
341
+
342
+ public void RemoveTriggersForKeys(IList<string> keys)
343
+ {
344
+ _removeTriggersForKeys(Json.Serialize(keys));
345
+ }
346
+
347
+ public object GetTriggerValueForKey(string key)
348
+ {
349
+ Dictionary<string, object> triggerValue =
350
+ Json.Deserialize(_getTriggerValueForKey(key)) as Dictionary<string, object>;
351
+ return triggerValue["value"];
352
+ }
353
+
354
+ public void PauseInAppMessages(bool pause)
355
+ {
356
+ _pauseInAppMessages(pause);
357
+ }
358
+
359
+ public void EnableVibrate(bool enable)
360
+ {
361
+ }
362
+
363
+ public void EnableSound(bool enable)
364
+ {
365
+ }
366
+
367
+ public void ClearOneSignalNotifications()
368
+ {
369
+ }
370
+
371
+ public void SendOutcome(string delegateId, string name)
372
+ {
373
+ _sendOutcome(delegateId, name);
374
+ }
375
+
376
+ public void SendUniqueOutcome(string delegateId, string name)
377
+ {
378
+ _sendUniqueOutcome(delegateId, name);
379
+ }
380
+
381
+ public void SendOutcomeWithValue(string delegateId, string name, float value)
382
+ {
383
+ _sendOutcomeWithValue(delegateId, name, value);
384
+ }
385
+
386
+ public OSPermissionSubscriptionState GetPermissionSubscriptionState()
387
+ {
388
+ return OneSignalPlatformHelper.ParsePermissionSubscriptionState(this, _getPermissionSubscriptionState());
389
+ }
390
+
391
+ public OSPermissionStateChanges ParseOSPermissionStateChanges(string jsonStat)
392
+ {
393
+ return OneSignalPlatformHelper.ParseOSPermissionStateChanges(this, jsonStat);
394
+ }
395
+
396
+ public OSEmailSubscriptionStateChanges ParseOSEmailSubscriptionStateChanges(string jsonState)
397
+ {
398
+ return OneSignalPlatformHelper.ParseOSEmailSubscriptionStateChanges(this, jsonState);
399
+ }
400
+
401
+ public OSSubscriptionStateChanges ParseOSSubscriptionStateChanges(string jsonStat)
402
+ {
403
+ return OneSignalPlatformHelper.ParseOSSubscriptionStateChanges(this, jsonStat);
404
+ }
405
+
406
+ public OSPermissionState ParseOSPermissionState(object stateDict)
407
+ {
408
+ var stateDictCasted = stateDict as Dictionary<string, object>;
409
+
410
+ var state = new OSPermissionState();
411
+ state.hasPrompted = Convert.ToBoolean(stateDictCasted["hasPrompted"]);
412
+ state.status = (OSNotificationPermission) Convert.ToInt32(stateDictCasted["status"]);
413
+
414
+ return state;
415
+ }
416
+
417
+ public OSSubscriptionState ParseOSSubscriptionState(object stateDict)
418
+ {
419
+ var stateDictCasted = stateDict as Dictionary<string, object>;
420
+
421
+ var state = new OSSubscriptionState();
422
+ state.subscribed = Convert.ToBoolean(stateDictCasted["subscribed"]);
423
+ state.userSubscriptionSetting = Convert.ToBoolean(stateDictCasted["userSubscriptionSetting"]);
424
+ state.userId = stateDictCasted["userId"] as string;
425
+ state.pushToken = stateDictCasted["pushToken"] as string;
426
+
427
+ return state;
428
+ }
429
+
430
+ public OSEmailSubscriptionState ParseOSEmailSubscriptionState(object stateDict)
431
+ {
432
+ var stateDictCasted = stateDict as Dictionary<string, object>;
433
+
434
+ var state = new OSEmailSubscriptionState();
435
+
436
+ if (stateDictCasted.ContainsKey("emailUserId"))
437
+ {
438
+ state.emailUserId = stateDictCasted["emailUserId"] as string;
439
+ }
440
+ else
441
+ {
442
+ state.emailUserId = "";
443
+ }
444
+
445
+ if (stateDictCasted.ContainsKey("emailAddress"))
446
+ {
447
+ state.emailAddress = stateDictCasted["emailAddress"] as string;
448
+ }
449
+ else
450
+ {
451
+ state.emailAddress = "";
452
+ }
453
+
454
+ state.subscribed = stateDictCasted.ContainsKey("emailUserId") && stateDictCasted["emailUserId"] != null;
455
+
456
+ return state;
457
+ }
458
+ }