OneSignal-iOS-SDK icon indicating copy to clipboard operation
OneSignal-iOS-SDK copied to clipboard

[Bug]: External id is not setup on application launch

Open Kalo2412 opened this issue 1 year ago • 1 comments

What happened?

The external id is not set on application launch, when I check it in the OneSignal Dashboard

import SwiftUI
import OneSignalFramework
import OSLog

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        OneSignal.Debug.setLogLevel(.LL_VERBOSE)
        
        OneSignal.initialize("one singal app id")
        OneSignal.Notifications.requestPermission({ accepted in
            if accepted {
                Logger.logInfo(message: "Notification permission accepted: \(accepted)")
            } else {
                Logger.logInfo(message: "User did not accept notifications")
            }
        }, fallbackToSettings: true)
        
        OneSignal.login("1010101010101")

            
        return true
    }
}

@main
struct TeamScheduleApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            LandingPageView()
        }
    }
}

Steps to reproduce?

1. Install from Swift Package Manager the latest version of OneSignal iOS SDK 5.2.5
2. Start the application with the code provided up
3. Check the console output

What did you expect to happen?

The external id to be properly set in the onesignal dashboard

OneSignal iOS SDK version

Release 5.2.5

iOS version

17

Specific iOS version

* iOS 17.6.1

Relevant log output

WARNING: OneSignalUserManagerImpl.startNewSession() is unable to fetch user with External ID 10101 due to null OneSignal ID
WARNING: OSUserExecutor.executePendingRequests() is blocked by unexecutable request <OSRequestIdentifyUser with external_id: 10101>

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Kalo2412 avatar Oct 08 '24 13:10 Kalo2412

Any progress?

Kalo2412 avatar Oct 21 '24 10:10 Kalo2412

Any progress?

Kalo2412 avatar Nov 04 '24 09:11 Kalo2412

Hi @Kalo2412, apologies for the delay. The external ID is not set as the login request has failed. Do you have the full logs so we can see what requests and payload the SDK sent and what the server responses are?

nan-li avatar Dec 05 '24 18:12 nan-li

Need logs to see what requests failed that is preventing adding external ID.

nan-li avatar Jan 10 '25 19:01 nan-li

The problem was that we manually delete a user from the one signal dashboard and than we try to subscribe again, maybe the backend needs some time to refresh the data ?

Kalo2412 avatar Jan 14 '25 15:01 Kalo2412

The problem was that we manually delete a user from the one signal dashboard and than we try to subscribe again, maybe the backend needs some time to refresh the data ?

At a high level, this shouldn't be a problem. We still need the reproduction logs, ideally starting from a new installation The two logs you included show a problem that appears to be a different issue.

nan-li avatar Jan 21 '25 18:01 nan-li