@onairos/react-native 3.0.45 → 3.0.47
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/lib/commonjs/components/UniversalOnboarding.js +83 -88
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/index.js +437 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +83 -88
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/index.js +9 -10
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/UniversalOnboarding.tsx +87 -95
package/lib/commonjs/index.js
CHANGED
|
@@ -3,16 +3,441 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
COLORS: true,
|
|
8
|
+
PLATFORMS: true,
|
|
9
|
+
API_ENDPOINTS: true,
|
|
10
|
+
STORAGE_KEYS: true,
|
|
11
|
+
PIN_REQUIREMENTS: true,
|
|
12
|
+
DEEP_LINK_CONFIG: true,
|
|
13
|
+
storeCredentials: true,
|
|
14
|
+
getCredentials: true,
|
|
15
|
+
hasCredentials: true,
|
|
16
|
+
deleteCredentials: true,
|
|
17
|
+
updateCredentials: true,
|
|
18
|
+
generateDeviceUsername: true,
|
|
19
|
+
verifyCredentials: true,
|
|
20
|
+
validateCredentials: true,
|
|
21
|
+
createAccount: true,
|
|
22
|
+
authenticate: true,
|
|
23
|
+
refreshToken: true,
|
|
24
|
+
getPlatformData: true,
|
|
25
|
+
getUserProfile: true,
|
|
26
|
+
updatePlatformConnections: true,
|
|
27
|
+
rsaEncrypt: true,
|
|
28
|
+
sha256: true,
|
|
29
|
+
base64ToBuffer: true,
|
|
30
|
+
logDebug: true,
|
|
31
|
+
logError: true,
|
|
32
|
+
isDebugMode: true,
|
|
33
|
+
connectPlatform: true,
|
|
34
|
+
disconnectPlatform: true,
|
|
35
|
+
initializeOAuthService: true,
|
|
36
|
+
cleanupOAuthService: true,
|
|
37
|
+
storePlatformConnection: true,
|
|
38
|
+
OAuthService: true,
|
|
39
|
+
onairosApi: true,
|
|
40
|
+
useCredentials: true,
|
|
41
|
+
useConnections: true,
|
|
42
|
+
Portal: true,
|
|
43
|
+
PortalHost: true,
|
|
44
|
+
ConnectorScreen: true,
|
|
45
|
+
PinCreationScreen: true,
|
|
46
|
+
LoadingScreen: true,
|
|
47
|
+
OAuthWebView: true,
|
|
48
|
+
PlatformConnector: true,
|
|
49
|
+
OnboardingHeader: true,
|
|
50
|
+
PlatformList: true,
|
|
51
|
+
PinInput: true,
|
|
52
|
+
TrainingModal: true,
|
|
53
|
+
Overlay: true,
|
|
54
|
+
UniversalOnboarding: true,
|
|
55
|
+
OnairosButton: true,
|
|
56
|
+
Onairos: true
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, "API_ENDPOINTS", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () {
|
|
61
|
+
return _constants.API_ENDPOINTS;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "COLORS", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return _constants.COLORS;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "ConnectorScreen", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () {
|
|
73
|
+
return _ConnectorScreen.ConnectorScreen;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "DEEP_LINK_CONFIG", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _constants.DEEP_LINK_CONFIG;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "LoadingScreen", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return _LoadingScreen.LoadingScreen;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "OAuthService", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () {
|
|
91
|
+
return _oauthService.OAuthService;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "OAuthWebView", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () {
|
|
97
|
+
return _OAuthWebView.OAuthWebView;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(exports, "Onairos", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () {
|
|
103
|
+
return _Onairos.Onairos;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "OnairosButton", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () {
|
|
109
|
+
return _OnairosButton.OnairosButton;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(exports, "OnboardingHeader", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function () {
|
|
115
|
+
return _OnboardingHeader.OnboardingHeader;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "Overlay", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return _Overlay.Overlay;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "PIN_REQUIREMENTS", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () {
|
|
127
|
+
return _constants.PIN_REQUIREMENTS;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "PLATFORMS", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () {
|
|
133
|
+
return _constants.PLATFORMS;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, "PinCreationScreen", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return _PinCreationScreen.PinCreationScreen;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "PinInput", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _PinInput.PinInput;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "PlatformConnector", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () {
|
|
151
|
+
return _PlatformConnector.PlatformConnector;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "PlatformList", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return _PlatformList.PlatformList;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "Portal", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return _Portal.Portal;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "PortalHost", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () {
|
|
169
|
+
return _Portal.PortalHost;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, "STORAGE_KEYS", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return _constants.STORAGE_KEYS;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "TrainingModal", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () {
|
|
181
|
+
return _TrainingModal.TrainingModal;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, "UniversalOnboarding", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return _UniversalOnboarding.UniversalOnboarding;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, "authenticate", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function () {
|
|
193
|
+
return _onairosApi.authenticate;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(exports, "base64ToBuffer", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function () {
|
|
199
|
+
return _crypto.base64ToBuffer;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "cleanupOAuthService", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function () {
|
|
205
|
+
return _oauthService.cleanupOAuthService;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "connectPlatform", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _oauthService.connectPlatform;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(exports, "createAccount", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function () {
|
|
217
|
+
return _onairosApi.createAccount;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
exports.default = void 0;
|
|
221
|
+
Object.defineProperty(exports, "deleteCredentials", {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
get: function () {
|
|
224
|
+
return _secureStorage.deleteCredentials;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(exports, "disconnectPlatform", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function () {
|
|
230
|
+
return _oauthService.disconnectPlatform;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(exports, "generateDeviceUsername", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function () {
|
|
236
|
+
return _secureStorage.generateDeviceUsername;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
Object.defineProperty(exports, "getCredentials", {
|
|
240
|
+
enumerable: true,
|
|
241
|
+
get: function () {
|
|
242
|
+
return _secureStorage.getCredentials;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
Object.defineProperty(exports, "getPlatformData", {
|
|
246
|
+
enumerable: true,
|
|
247
|
+
get: function () {
|
|
248
|
+
return _onairosApi.getPlatformData;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
Object.defineProperty(exports, "getUserProfile", {
|
|
252
|
+
enumerable: true,
|
|
253
|
+
get: function () {
|
|
254
|
+
return _onairosApi.getUserProfile;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
Object.defineProperty(exports, "hasCredentials", {
|
|
258
|
+
enumerable: true,
|
|
259
|
+
get: function () {
|
|
260
|
+
return _secureStorage.hasCredentials;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
Object.defineProperty(exports, "initializeOAuthService", {
|
|
264
|
+
enumerable: true,
|
|
265
|
+
get: function () {
|
|
266
|
+
return _oauthService.initializeOAuthService;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
Object.defineProperty(exports, "isDebugMode", {
|
|
270
|
+
enumerable: true,
|
|
271
|
+
get: function () {
|
|
272
|
+
return _debugHelper.isDebugMode;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
Object.defineProperty(exports, "logDebug", {
|
|
276
|
+
enumerable: true,
|
|
277
|
+
get: function () {
|
|
278
|
+
return _debugHelper.logDebug;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
Object.defineProperty(exports, "logError", {
|
|
282
|
+
enumerable: true,
|
|
283
|
+
get: function () {
|
|
284
|
+
return _debugHelper.logError;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
Object.defineProperty(exports, "onairosApi", {
|
|
288
|
+
enumerable: true,
|
|
289
|
+
get: function () {
|
|
290
|
+
return _api.onairosApi;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
Object.defineProperty(exports, "refreshToken", {
|
|
294
|
+
enumerable: true,
|
|
295
|
+
get: function () {
|
|
296
|
+
return _onairosApi.refreshToken;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
Object.defineProperty(exports, "rsaEncrypt", {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get: function () {
|
|
302
|
+
return _crypto.rsaEncrypt;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
Object.defineProperty(exports, "sha256", {
|
|
306
|
+
enumerable: true,
|
|
307
|
+
get: function () {
|
|
308
|
+
return _crypto.sha256;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
Object.defineProperty(exports, "storeCredentials", {
|
|
312
|
+
enumerable: true,
|
|
313
|
+
get: function () {
|
|
314
|
+
return _secureStorage.storeCredentials;
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
Object.defineProperty(exports, "storePlatformConnection", {
|
|
318
|
+
enumerable: true,
|
|
319
|
+
get: function () {
|
|
320
|
+
return _oauthService.storePlatformConnection;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
Object.defineProperty(exports, "updateCredentials", {
|
|
324
|
+
enumerable: true,
|
|
325
|
+
get: function () {
|
|
326
|
+
return _secureStorage.updateCredentials;
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
Object.defineProperty(exports, "updatePlatformConnections", {
|
|
330
|
+
enumerable: true,
|
|
331
|
+
get: function () {
|
|
332
|
+
return _onairosApi.updatePlatformConnections;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
Object.defineProperty(exports, "useConnections", {
|
|
336
|
+
enumerable: true,
|
|
337
|
+
get: function () {
|
|
338
|
+
return _useConnections.useConnections;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
Object.defineProperty(exports, "useCredentials", {
|
|
342
|
+
enumerable: true,
|
|
343
|
+
get: function () {
|
|
344
|
+
return _useCredentials.useCredentials;
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
Object.defineProperty(exports, "validateCredentials", {
|
|
348
|
+
enumerable: true,
|
|
349
|
+
get: function () {
|
|
350
|
+
return _onairosApi.validateCredentials;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
Object.defineProperty(exports, "verifyCredentials", {
|
|
354
|
+
enumerable: true,
|
|
355
|
+
get: function () {
|
|
356
|
+
return _secureStorage.verifyCredentials;
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
var _constants = require("./constants");
|
|
360
|
+
var _secureStorage = require("./utils/secureStorage");
|
|
361
|
+
Object.keys(_secureStorage).forEach(function (key) {
|
|
362
|
+
if (key === "default" || key === "__esModule") return;
|
|
363
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
364
|
+
if (key in exports && exports[key] === _secureStorage[key]) return;
|
|
365
|
+
Object.defineProperty(exports, key, {
|
|
366
|
+
enumerable: true,
|
|
367
|
+
get: function () {
|
|
368
|
+
return _secureStorage[key];
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
var _onairosApi = require("./utils/onairosApi");
|
|
373
|
+
var _crypto = require("./utils/crypto");
|
|
374
|
+
var _debugHelper = require("./utils/debugHelper");
|
|
375
|
+
var _oauthService = require("./services/oauthService");
|
|
376
|
+
var _api = require("./api");
|
|
377
|
+
var _encryption = require("./utils/encryption");
|
|
378
|
+
Object.keys(_encryption).forEach(function (key) {
|
|
379
|
+
if (key === "default" || key === "__esModule") return;
|
|
380
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
381
|
+
if (key in exports && exports[key] === _encryption[key]) return;
|
|
382
|
+
Object.defineProperty(exports, key, {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
get: function () {
|
|
385
|
+
return _encryption[key];
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
var _useCredentials = require("./hooks/useCredentials");
|
|
390
|
+
var _useConnections = require("./hooks/useConnections");
|
|
391
|
+
var _Portal = require("./utils/Portal");
|
|
392
|
+
var _ConnectorScreen = require("./components/screens/ConnectorScreen");
|
|
393
|
+
var _PinCreationScreen = require("./components/screens/PinCreationScreen");
|
|
394
|
+
var _LoadingScreen = require("./components/screens/LoadingScreen");
|
|
395
|
+
var _OAuthWebView = require("./components/onboarding/OAuthWebView");
|
|
396
|
+
var _PlatformConnector = require("./components/onboarding/PlatformConnector");
|
|
397
|
+
var _OnboardingHeader = require("./components/onboarding/OnboardingHeader");
|
|
398
|
+
var _PlatformList = require("./components/PlatformList");
|
|
399
|
+
var _PinInput = require("./components/PinInput");
|
|
400
|
+
var _TrainingModal = require("./components/TrainingModal");
|
|
401
|
+
var _Overlay = require("./components/Overlay");
|
|
402
|
+
var _UniversalOnboarding = require("./components/UniversalOnboarding");
|
|
403
|
+
var _OnairosButton = require("./components/OnairosButton");
|
|
404
|
+
var _Onairos = require("./components/Onairos");
|
|
405
|
+
/**
|
|
406
|
+
* Onairos React Native SDK
|
|
407
|
+
* A React Native implementation for Onairos personalized data integration
|
|
408
|
+
*/
|
|
409
|
+
|
|
410
|
+
// Export types first to avoid circular dependencies
|
|
411
|
+
|
|
412
|
+
// Export constants
|
|
413
|
+
|
|
414
|
+
// Export utilities
|
|
415
|
+
|
|
416
|
+
// Export services
|
|
417
|
+
|
|
418
|
+
// Export API and Services
|
|
419
|
+
|
|
420
|
+
// Export hooks
|
|
421
|
+
|
|
422
|
+
// Export Portal components
|
|
423
|
+
|
|
424
|
+
// Screen Components
|
|
425
|
+
|
|
426
|
+
// Onboarding Components
|
|
427
|
+
|
|
428
|
+
// Core Components - Export these last to avoid circular dependencies
|
|
429
|
+
|
|
430
|
+
// Define the public components for default export
|
|
431
|
+
|
|
432
|
+
// Simple default export object - main types are available through named exports
|
|
433
|
+
const components = {
|
|
434
|
+
Onairos: _Onairos.Onairos,
|
|
435
|
+
OnairosButton: _OnairosButton.OnairosButton,
|
|
436
|
+
OnairosOverlay: _Overlay.Overlay,
|
|
437
|
+
UniversalOnboarding: _UniversalOnboarding.UniversalOnboarding,
|
|
438
|
+
PortalHost: _Portal.PortalHost
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// Export the components as the default export
|
|
442
|
+
var _default = exports.default = components;
|
|
18
443
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_constants","require","_secureStorage","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_onairosApi","_crypto","_debugHelper","_oauthService","_api","_encryption","_useCredentials","_useConnections","_Portal","_ConnectorScreen","_PinCreationScreen","_LoadingScreen","_OAuthWebView","_PlatformConnector","_OnboardingHeader","_PlatformList","_PinInput","_TrainingModal","_Overlay","_UniversalOnboarding","_OnairosButton","_Onairos","components","Onairos","OnairosButton","OnairosOverlay","Overlay","UniversalOnboarding","PortalHost","_default","default"],"sourceRoot":"..\\..\\src","sources":["index.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -209,115 +209,110 @@ export const UniversalOnboarding = ({
|
|
|
209
209
|
|
|
210
210
|
// Instagram: Use Opacity SDK exclusively
|
|
211
211
|
if (platformId === 'instagram') {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
console.log('📱 Fetching Instagram profile...');
|
|
224
|
-
|
|
225
|
-
// Fetch Instagram profile using Opacity SDK
|
|
226
|
-
const profile = await opacityGet('flow:instagram:profile');
|
|
227
|
-
if (profile && typeof profile === 'object') {
|
|
228
|
-
console.log('✅ Instagram profile retrieved:', profile);
|
|
229
|
-
|
|
230
|
-
// Extract username from profile or use fallback
|
|
231
|
-
const instagramUsername = profile.username || profile.name || username;
|
|
212
|
+
console.log('🔌 Initializing Opacity SDK for Instagram...');
|
|
213
|
+
|
|
214
|
+
// Initialize Opacity SDK with your API key
|
|
215
|
+
const apiKey = 'OsamaTest-7bde2407-7360-462a-86b4-b26d7f890cbb';
|
|
216
|
+
await opacityInit({
|
|
217
|
+
apiKey,
|
|
218
|
+
environment: OpacityEnvironment.Production,
|
|
219
|
+
shouldShowErrorsInWebView: true
|
|
220
|
+
});
|
|
221
|
+
console.log('✅ Opacity SDK initialized successfully');
|
|
222
|
+
console.log('📱 Fetching Instagram profile...');
|
|
232
223
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}));
|
|
224
|
+
// Fetch Instagram profile using Opacity SDK
|
|
225
|
+
const profile = await opacityGet('flow:instagram:profile');
|
|
226
|
+
if (profile && typeof profile === 'object') {
|
|
227
|
+
console.log('✅ Instagram profile retrieved:', profile);
|
|
238
228
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
...prev,
|
|
242
|
-
[platformId]: {
|
|
243
|
-
userName: instagramUsername,
|
|
244
|
-
connected: true,
|
|
245
|
-
profileData: profile // Store additional profile data
|
|
246
|
-
}
|
|
247
|
-
}));
|
|
248
|
-
console.log(`✅ Instagram successfully connected for user: ${instagramUsername}`);
|
|
249
|
-
Alert.alert('Instagram Connected', `Successfully connected to Instagram as ${instagramUsername} via Opacity SDK.`, [{
|
|
250
|
-
text: 'OK',
|
|
251
|
-
style: 'default'
|
|
252
|
-
}]);
|
|
253
|
-
return; // Exit early on success
|
|
254
|
-
} else {
|
|
255
|
-
throw new Error('Invalid or empty Instagram profile data returned from Opacity SDK');
|
|
256
|
-
}
|
|
257
|
-
} catch (err) {
|
|
258
|
-
console.error('❌ Opacity SDK Instagram connection failed:', err);
|
|
259
|
-
|
|
260
|
-
// Provide user-friendly error messages
|
|
261
|
-
let errorMessage = 'Unknown error occurred';
|
|
262
|
-
if (err instanceof Error) {
|
|
263
|
-
if (err.message.includes('Initialize')) {
|
|
264
|
-
errorMessage = 'Failed to initialize Instagram connection. Please check your internet connection.';
|
|
265
|
-
} else if (err.message.includes('profile')) {
|
|
266
|
-
errorMessage = 'Unable to retrieve Instagram profile. Please try again or check your Instagram account permissions.';
|
|
267
|
-
} else {
|
|
268
|
-
errorMessage = err.message;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
Alert.alert('Instagram Connection Failed', errorMessage, [{
|
|
272
|
-
text: 'OK',
|
|
273
|
-
style: 'default'
|
|
274
|
-
}]);
|
|
275
|
-
return; // Exit early on error
|
|
276
|
-
} finally {
|
|
277
|
-
setIsConnectingPlatform(false);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
229
|
+
// Extract username from profile or use fallback
|
|
230
|
+
const instagramUsername = profile.username || profile.name || username;
|
|
280
231
|
|
|
281
|
-
// For all other platforms (non-Instagram), use existing authentication methods
|
|
282
|
-
// Check if platform has a native SDK
|
|
283
|
-
if (hasNativeSDK(platformId)) {
|
|
284
|
-
console.log(`📱 Using native SDK for ${platformId}`);
|
|
285
|
-
// Use native SDK for authentication
|
|
286
|
-
const success = await initiateNativeAuth(platformId);
|
|
287
|
-
if (success) {
|
|
288
|
-
console.log(`✅ Native authentication successful for ${platformId}`);
|
|
289
232
|
// Update platform toggle state
|
|
290
233
|
setPlatformToggles(prev => ({
|
|
291
234
|
...prev,
|
|
292
235
|
[platformId]: true
|
|
293
236
|
}));
|
|
294
237
|
|
|
295
|
-
// Update connections state
|
|
238
|
+
// Update connections state with Instagram data
|
|
296
239
|
setConnections(prev => ({
|
|
297
240
|
...prev,
|
|
298
241
|
[platformId]: {
|
|
299
|
-
userName:
|
|
300
|
-
connected: true
|
|
242
|
+
userName: instagramUsername,
|
|
243
|
+
connected: true,
|
|
244
|
+
profileData: profile // Store additional profile data
|
|
301
245
|
}
|
|
302
246
|
}));
|
|
247
|
+
console.log(`✅ Instagram successfully connected for user: ${instagramUsername}`);
|
|
248
|
+
Alert.alert('Instagram Connected', `Successfully connected to Instagram as ${instagramUsername} via Opacity SDK.`, [{
|
|
249
|
+
text: 'OK',
|
|
250
|
+
style: 'default'
|
|
251
|
+
}]);
|
|
252
|
+
} else {
|
|
253
|
+
throw new Error('Invalid or empty Instagram profile data returned from Opacity SDK');
|
|
303
254
|
}
|
|
304
255
|
} else {
|
|
305
|
-
|
|
306
|
-
//
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
256
|
+
// For all other platforms (non-Instagram), use existing authentication methods
|
|
257
|
+
// Check if platform has a native SDK
|
|
258
|
+
if (hasNativeSDK(platformId)) {
|
|
259
|
+
console.log(`📱 Using native SDK for ${platformId}`);
|
|
260
|
+
// Use native SDK for authentication
|
|
261
|
+
const success = await initiateNativeAuth(platformId);
|
|
262
|
+
if (success) {
|
|
263
|
+
console.log(`✅ Native authentication successful for ${platformId}`);
|
|
264
|
+
// Update platform toggle state
|
|
265
|
+
setPlatformToggles(prev => ({
|
|
266
|
+
...prev,
|
|
267
|
+
[platformId]: true
|
|
268
|
+
}));
|
|
269
|
+
|
|
270
|
+
// Update connections state
|
|
271
|
+
setConnections(prev => ({
|
|
272
|
+
...prev,
|
|
273
|
+
[platformId]: {
|
|
274
|
+
userName: username,
|
|
275
|
+
connected: true
|
|
276
|
+
}
|
|
277
|
+
}));
|
|
278
|
+
}
|
|
313
279
|
} else {
|
|
314
|
-
console.
|
|
315
|
-
|
|
280
|
+
console.log(`🌐 Initiating OAuth flow for ${platformId}`);
|
|
281
|
+
// Use OAuth flow through proxy server
|
|
282
|
+
const oauthUrl = await initiateOAuth(platformId, username, AppName);
|
|
283
|
+
if (oauthUrl) {
|
|
284
|
+
console.log(`✅ Received OAuth URL for ${platformId}:`, oauthUrl);
|
|
285
|
+
setCurrentPlatform(platformId);
|
|
286
|
+
setOauthUrl(oauthUrl);
|
|
287
|
+
setStep('oauth');
|
|
288
|
+
} else {
|
|
289
|
+
console.error(`❌ No OAuth URL returned for ${platformId}`);
|
|
290
|
+
Alert.alert('Error', 'Failed to get authorization URL for this platform. Please try again.');
|
|
291
|
+
}
|
|
316
292
|
}
|
|
317
293
|
}
|
|
318
294
|
} catch (error) {
|
|
319
295
|
console.error(`❌ Error connecting ${platformId}:`, error);
|
|
320
|
-
|
|
296
|
+
|
|
297
|
+
// Provide user-friendly error messages based on platform
|
|
298
|
+
let errorMessage = 'Unknown error occurred';
|
|
299
|
+
if (error instanceof Error) {
|
|
300
|
+
if (platformId === 'instagram') {
|
|
301
|
+
if (error.message.includes('Initialize')) {
|
|
302
|
+
errorMessage = 'Failed to initialize Instagram connection. Please check your internet connection.';
|
|
303
|
+
} else if (error.message.includes('profile')) {
|
|
304
|
+
errorMessage = 'Unable to retrieve Instagram profile. Please try again or check your Instagram account permissions.';
|
|
305
|
+
} else {
|
|
306
|
+
errorMessage = error.message;
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
errorMessage = error.message;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
Alert.alert(`${platformId.charAt(0).toUpperCase() + platformId.slice(1)} Connection Failed`, errorMessage, [{
|
|
313
|
+
text: 'OK',
|
|
314
|
+
style: 'default'
|
|
315
|
+
}]);
|
|
321
316
|
} finally {
|
|
322
317
|
setIsConnectingPlatform(false);
|
|
323
318
|
}
|