com.onesignal.unity.ios 3.0.9 → 5.0.0-beta.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.
- package/Editor/BuildPostProcessor.cs +4 -2
- package/Editor/OneSignaliOSDependencies.xml +5 -0
- package/Editor/OneSignaliOSDependencies.xml.meta +7 -0
- package/Editor/PBXProjectExtensions.cs +1 -1
- package/Runtime/OneSignaliOS.cs +178 -0
- package/Runtime/OneSignaliOS.cs.meta +11 -0
- package/Runtime/{OneSignalIOSInit.cs → OneSignaliOSInit.cs} +3 -3
- package/Runtime/OneSignaliOSInit.cs.meta +11 -0
- package/Runtime/Plugins/iOS/NotificationService.swift +1 -1
- package/Runtime/Plugins/iOS/OneSignalBridgeUtil.h +35 -0
- package/Runtime/Plugins/iOS/OneSignalBridgeUtil.h.meta +27 -0
- package/Runtime/Plugins/iOS/OneSignalBridgeUtil.mm +49 -0
- package/Runtime/Plugins/iOS/OneSignalBridgeUtil.mm.meta +37 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridge.mm +36 -383
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeDebug.mm +40 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeDebug.mm.meta +37 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeInAppMessages.mm +167 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeInAppMessages.mm.meta +37 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeLocation.mm +44 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeLocation.mm.meta +37 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeNotifications.mm +124 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeNotifications.mm.meta +37 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeSession.mm +55 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeSession.mm.meta +37 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeUser.mm +197 -0
- package/Runtime/Plugins/iOS/OneSignalUnityBridgeUser.mm.meta +37 -0
- package/Runtime/Plugins/iOS/UIApplication+OneSignalUnity.mm +6 -3
- package/Runtime/Utilities/WaitingProxy.cs +52 -0
- package/Runtime/Utilities/WaitingProxy.cs.meta +11 -0
- package/Runtime/iOSDebugManager.cs +57 -0
- package/Runtime/iOSDebugManager.cs.meta +11 -0
- package/Runtime/iOSInAppMessagesManager.cs +118 -0
- package/Runtime/iOSInAppMessagesManager.cs.meta +11 -0
- package/Runtime/iOSLocationManager.cs +48 -0
- package/Runtime/iOSLocationManager.cs.meta +11 -0
- package/Runtime/iOSNotificationsManager.cs +148 -0
- package/Runtime/iOSNotificationsManager.cs.meta +11 -0
- package/Runtime/iOSPushSubscription.cs +81 -0
- package/Runtime/iOSPushSubscription.cs.meta +11 -0
- package/Runtime/iOSSessionManager.cs +47 -0
- package/Runtime/iOSSessionManager.cs.meta +11 -0
- package/Runtime/iOSUserManager.cs +106 -0
- package/Runtime/iOSUserManager.cs.meta +11 -0
- package/package.json +2 -2
- package/Editor/OneSignalIOSDependencies.xml +0 -5
- package/Editor/OneSignalIOSDependencies.xml.meta +0 -3
- package/Runtime/OneSignalIOS.Callbacks.cs +0 -181
- package/Runtime/OneSignalIOS.Callbacks.cs.meta +0 -3
- package/Runtime/OneSignalIOS.Interface.cs +0 -102
- package/Runtime/OneSignalIOS.Interface.cs.meta +0 -3
- package/Runtime/OneSignalIOS.Mappings.cs +0 -96
- package/Runtime/OneSignalIOS.Mappings.cs.meta +0 -3
- package/Runtime/OneSignalIOS.cs +0 -257
- package/Runtime/OneSignalIOS.cs.meta +0 -3
- package/Runtime/OneSignalIOSInit.cs.meta +0 -3
package/Runtime/OneSignalIOS.cs
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Modified MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2022 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.Collections.Generic;
|
|
29
|
-
using System.Linq;
|
|
30
|
-
using System.Threading.Tasks;
|
|
31
|
-
using UnityEngine;
|
|
32
|
-
|
|
33
|
-
namespace OneSignalSDK {
|
|
34
|
-
public sealed partial class OneSignalIOS : OneSignal {
|
|
35
|
-
public override event NotificationWillShowDelegate NotificationWillShow;
|
|
36
|
-
public override event NotificationActionDelegate NotificationOpened;
|
|
37
|
-
public override event InAppMessageLifecycleDelegate InAppMessageWillDisplay;
|
|
38
|
-
public override event InAppMessageLifecycleDelegate InAppMessageDidDisplay;
|
|
39
|
-
public override event InAppMessageLifecycleDelegate InAppMessageWillDismiss;
|
|
40
|
-
public override event InAppMessageLifecycleDelegate InAppMessageDidDismiss;
|
|
41
|
-
public override event InAppMessageActionDelegate InAppMessageTriggeredAction;
|
|
42
|
-
public override event StateChangeDelegate<NotificationPermission> NotificationPermissionChanged;
|
|
43
|
-
public override event StateChangeDelegate<PushSubscriptionState> PushSubscriptionStateChanged;
|
|
44
|
-
public override event StateChangeDelegate<EmailSubscriptionState> EmailSubscriptionStateChanged;
|
|
45
|
-
public override event StateChangeDelegate<SMSSubscriptionState> SMSSubscriptionStateChanged;
|
|
46
|
-
|
|
47
|
-
public override NotificationPermission NotificationPermission {
|
|
48
|
-
get {
|
|
49
|
-
var deviceState = JsonUtility.FromJson<DeviceState>(_getDeviceState());
|
|
50
|
-
return (NotificationPermission)deviceState.notificationPermissionStatus;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public override PushSubscriptionState PushSubscriptionState
|
|
55
|
-
=> JsonUtility.FromJson<DeviceState>(_getDeviceState());
|
|
56
|
-
|
|
57
|
-
public override EmailSubscriptionState EmailSubscriptionState
|
|
58
|
-
=> JsonUtility.FromJson<DeviceState>(_getDeviceState());
|
|
59
|
-
|
|
60
|
-
public override SMSSubscriptionState SMSSubscriptionState
|
|
61
|
-
=> JsonUtility.FromJson<DeviceState>(_getDeviceState());
|
|
62
|
-
|
|
63
|
-
public override LogLevel LogLevel {
|
|
64
|
-
get => _logLevel;
|
|
65
|
-
set {
|
|
66
|
-
_logLevel = value;
|
|
67
|
-
_setLogLevel((int) _logLevel, (int) _alertLevel);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public override LogLevel AlertLevel {
|
|
72
|
-
get => _alertLevel;
|
|
73
|
-
set {
|
|
74
|
-
_alertLevel = value;
|
|
75
|
-
_setLogLevel((int) _logLevel, (int) _alertLevel);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public override bool PrivacyConsent {
|
|
80
|
-
get => _getPrivacyConsent();
|
|
81
|
-
set => _setPrivacyConsent(value);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public override bool RequiresPrivacyConsent {
|
|
85
|
-
get => _getRequiresPrivacyConsent();
|
|
86
|
-
set => _setRequiresPrivacyConsent(value);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
public override void SetLaunchURLsInApp(bool launchInApp)
|
|
90
|
-
=> _setLaunchURLsInApp(launchInApp);
|
|
91
|
-
|
|
92
|
-
public override void Initialize(string appId) {
|
|
93
|
-
_initialize(appId);
|
|
94
|
-
_completedInit(appId);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public override async Task<NotificationPermission> PromptForPushNotificationsWithUserResponse() {
|
|
98
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
99
|
-
_promptForPushNotificationsWithUserResponse(hashCode, BooleanCallbackProxy);
|
|
100
|
-
return await proxy ? NotificationPermission.Authorized : NotificationPermission.Denied;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
public override void ClearOneSignalNotifications()
|
|
104
|
-
=> SDKDebug.Info("ClearOneSignalNotifications invoked on iOS, does nothing");
|
|
105
|
-
|
|
106
|
-
public override bool PushEnabled {
|
|
107
|
-
get {
|
|
108
|
-
var deviceState = JsonUtility.FromJson<DeviceState>(_getDeviceState());
|
|
109
|
-
return !deviceState.isPushDisabled;
|
|
110
|
-
}
|
|
111
|
-
set => _disablePush(!value);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
public override async Task<Dictionary<string, object>> PostNotification(Dictionary<string, object> options) {
|
|
115
|
-
var (proxy, hashCode) = _setupProxy<string>();
|
|
116
|
-
_postNotification(Json.Serialize(options), hashCode, StringCallbackProxy);
|
|
117
|
-
return Json.Deserialize(await proxy) as Dictionary<string, object>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
public override void SetTrigger(string key, string value)
|
|
121
|
-
=> _setTrigger(key, value);
|
|
122
|
-
|
|
123
|
-
public override void SetTriggers(Dictionary<string, string> triggers)
|
|
124
|
-
=> _setTriggers(Json.Serialize(triggers));
|
|
125
|
-
|
|
126
|
-
public override void RemoveTrigger(string key)
|
|
127
|
-
=> _removeTrigger(key);
|
|
128
|
-
|
|
129
|
-
public override void RemoveTriggers(params string[] keys)
|
|
130
|
-
=> _removeTriggers(Json.Serialize(keys));
|
|
131
|
-
|
|
132
|
-
public override string GetTrigger(string key)
|
|
133
|
-
=> _getTrigger(key);
|
|
134
|
-
|
|
135
|
-
public override Dictionary<string, string> GetTriggers() {
|
|
136
|
-
var triggersDict = Json.Deserialize(_getTriggers()) as Dictionary<string, object>;
|
|
137
|
-
return triggersDict?.ToDictionary(item => item.Key,
|
|
138
|
-
item => item.Value as string
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
public override bool InAppMessagesArePaused {
|
|
143
|
-
get => _getInAppMessagesArePaused();
|
|
144
|
-
set => _setInAppMessagesArePaused(value);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
public override async Task<bool> SendTag(string key, object value) {
|
|
148
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
149
|
-
_sendTag(key, value.ToString(), hashCode, BooleanCallbackProxy);
|
|
150
|
-
return await proxy;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
public override async Task<bool> SendTags(Dictionary<string, object> tags) {
|
|
154
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
155
|
-
_sendTags(Json.Serialize(tags), hashCode, BooleanCallbackProxy);
|
|
156
|
-
return await proxy;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
public override async Task<Dictionary<string, object>> GetTags() {
|
|
160
|
-
var (proxy, hashCode) = _setupProxy<string>();
|
|
161
|
-
_getTags(hashCode, StringCallbackProxy);
|
|
162
|
-
return Json.Deserialize(await proxy) as Dictionary<string, object>;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
public override async Task<bool> DeleteTag(string key) {
|
|
166
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
167
|
-
_deleteTag(key, hashCode, BooleanCallbackProxy);
|
|
168
|
-
return await proxy;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
public override async Task<bool> DeleteTags(params string[] keys) {
|
|
172
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
173
|
-
_deleteTags(Json.Serialize(keys), hashCode, BooleanCallbackProxy);
|
|
174
|
-
return await proxy;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
public override async Task<bool> SetExternalUserId(string externalId, string authHash = null) {
|
|
178
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
179
|
-
_setExternalUserId(externalId, authHash, hashCode, BooleanCallbackProxy);
|
|
180
|
-
return await proxy;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
public override async Task<bool> SetEmail(string email, string authHash = null) {
|
|
184
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
185
|
-
_setEmail(email, authHash, hashCode, BooleanCallbackProxy);
|
|
186
|
-
return await proxy;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
public override async Task<bool> SetSMSNumber(string smsNumber, string authHash = null) {
|
|
190
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
191
|
-
_setSMSNumber(smsNumber, authHash, hashCode, BooleanCallbackProxy);
|
|
192
|
-
return await proxy;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
public override async Task<bool> RemoveExternalUserId() {
|
|
196
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
197
|
-
_removeExternalUserId(hashCode, BooleanCallbackProxy);
|
|
198
|
-
return await proxy;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
public override async Task<bool> LogOutEmail() {
|
|
202
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
203
|
-
_logoutEmail(hashCode, BooleanCallbackProxy);
|
|
204
|
-
return await proxy;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
public override async Task<bool> LogOutSMS() {
|
|
208
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
209
|
-
_logoutSMSNumber(hashCode, BooleanCallbackProxy);
|
|
210
|
-
return await proxy;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
public override async Task<bool> SetLanguage(string languageCode) {
|
|
214
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
215
|
-
_setLanguage(languageCode, hashCode, BooleanCallbackProxy);
|
|
216
|
-
return await proxy;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
public override void PromptLocation()
|
|
220
|
-
=> _promptLocation();
|
|
221
|
-
|
|
222
|
-
public override bool ShareLocation {
|
|
223
|
-
get => _getShareLocation();
|
|
224
|
-
set => _setShareLocation(value);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
public override async Task<bool> SendOutcome(string name) {
|
|
228
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
229
|
-
_sendOutcome(name, hashCode, BooleanCallbackProxy);
|
|
230
|
-
return await proxy;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
public override async Task<bool> SendUniqueOutcome(string name) {
|
|
234
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
235
|
-
_sendUniqueOutcome(name, hashCode, BooleanCallbackProxy);
|
|
236
|
-
return await proxy;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
public override async Task<bool> SendOutcomeWithValue(string name, float value) {
|
|
240
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
241
|
-
_sendOutcomeWithValue(name, value, hashCode, BooleanCallbackProxy);
|
|
242
|
-
return await proxy;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
public override async Task<bool> EnterLiveActivity(string activityId, string token) {
|
|
246
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
247
|
-
_enterLiveActivity(activityId, token, hashCode, BooleanCallbackProxy);
|
|
248
|
-
return await proxy;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
public override async Task<bool> ExitLiveActivity(string activityId) {
|
|
252
|
-
var (proxy, hashCode) = _setupProxy<bool>();
|
|
253
|
-
_exitLiveActivity(activityId, hashCode, BooleanCallbackProxy);
|
|
254
|
-
return await proxy;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|