Skip to content

Commit

Permalink
Clean up test code
Browse files Browse the repository at this point in the history
  • Loading branch information
jinliu9508 committed Feb 9, 2024
1 parent d3c1db5 commit 37edcdb
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,12 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
startupService = services.getService()
startupService!!.bootstrap()

forceCreateUser = true;
if (forceCreateUser || !identityModelStore!!.model.hasProperty(IdentityConstants.ONESIGNAL_ID)) {
var legacyPlayerId =
val legacyPlayerId =
preferencesService!!.getString(
PreferenceStores.ONESIGNAL,
PreferenceOneSignalKeys.PREFS_LEGACY_PLAYER_ID,
)
// creating a non-null legacyPlayerId
legacyPlayerId = "temp";
if (legacyPlayerId == null) {
Logging.debug("initWithContext: creating new device-scoped user")
createAndSwitchToNewUser()
Expand All @@ -272,15 +269,13 @@ internal class OneSignalImp : IOneSignal, IServiceProvider {
// Converting a 4.x SDK to the 5.x SDK. We pull the legacy user sync values to create the subscription model, then enqueue
// a specialized `LoginUserFromSubscriptionOperation`, which will drive fetching/refreshing of the local user
// based on the subscription ID we do have.
var legacyUserSyncString =
val legacyUserSyncString =
preferencesService!!.getString(
PreferenceStores.ONESIGNAL,
PreferenceOneSignalKeys.PREFS_LEGACY_USER_SYNCVALUES,
)
var suppressBackendOperation = false

// creating a non-null legacyUserSyncString
legacyUserSyncString = "{name: test}";
if (legacyUserSyncString != null) {
val legacyUserSyncJSON = JSONObject(legacyUserSyncString)
val notificationTypes = legacyUserSyncJSON.safeInt("notification_types")
Expand Down

0 comments on commit 37edcdb

Please sign in to comment.