@@ -246,12 +246,15 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
246
246
startupService = services.getService()
247
247
startupService!! .bootstrap()
248
248
249
+ forceCreateUser = true ;
249
250
if (forceCreateUser || ! identityModelStore!! .model.hasProperty(IdentityConstants .ONESIGNAL_ID )) {
250
- val legacyPlayerId =
251
+ var legacyPlayerId =
251
252
preferencesService!! .getString(
252
253
PreferenceStores .ONESIGNAL ,
253
254
PreferenceOneSignalKeys .PREFS_LEGACY_PLAYER_ID ,
254
255
)
256
+ // creating a non-null legacyPlayerId
257
+ legacyPlayerId = " temp" ;
255
258
if (legacyPlayerId == null ) {
256
259
Logging .debug(" initWithContext: creating new device-scoped user" )
257
260
createAndSwitchToNewUser()
@@ -268,13 +271,15 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
268
271
// Converting a 4.x SDK to the 5.x SDK. We pull the legacy user sync values to create the subscription model, then enqueue
269
272
// a specialized `LoginUserFromSubscriptionOperation`, which will drive fetching/refreshing of the local user
270
273
// based on the subscription ID we do have.
271
- val legacyUserSyncString =
274
+ var legacyUserSyncString =
272
275
preferencesService!! .getString(
273
276
PreferenceStores .ONESIGNAL ,
274
277
PreferenceOneSignalKeys .PREFS_LEGACY_USER_SYNCVALUES ,
275
278
)
276
279
var suppressBackendOperation = false
277
280
281
+ // creating a non-null legacyUserSyncString
282
+ legacyUserSyncString = " {name: test}" ;
278
283
if (legacyUserSyncString != null ) {
279
284
val legacyUserSyncJSON = JSONObject (legacyUserSyncString)
280
285
val notificationTypes = legacyUserSyncJSON.getInt(" notification_types" )
0 commit comments