Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Login sometime not working on iOS and HTTP Client Error with status code: 500 #919

Closed
2 of 3 tasks
FantaMagier opened this issue Jul 4, 2024 · 4 comments
Closed
2 of 3 tasks

Comments

@FantaMagier
Copy link

FantaMagier commented Jul 4, 2024

What happened?

On the latest version of the Flutter OneSignal SDK, I think the login function doesn't work on some devices. The patch request https://api.onesignal.com/apps/APPID/users/by/onesignal_id/ONESIGNALID gets a 500 request on some iOS devices. In the OneSignal dashboard you can see that login sometimes does not work. I think this is related.`

Steps to reproduce?

1. Install latest OneSignal Flutter SDK
2. Use this Code: (I am useing the Qonversion User ID which is working on Android and on some iOS Devices) This ID is a normal String 

Init in main:

OneSignal.Debug.setLogLevel(isTestMode ? OSLogLevel.verbose : OSLogLevel.none);

  OneSignal.consentRequired(true);

  OneSignal.initialize(ID);

In the Func to start the prompt


  await OneSignal.consentGiven(true);
              QUser qonID = await Qonversion.getSharedInstance().userInfo();

              // ignore: unnecessary_string_interpolations
              await OneSignal.login("${qonID.qonversionId.toString()}");

              await OneSignal.Notifications.requestPermission(true);

What did you expect to happen?

The External ID is set correctly and the user don't get a 500 Response Code

OneSignal Flutter SDK version

onesignal_flutter: ^5.2.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jkasten2
Copy link
Member

@FantaMagier could you share the exact payload from the xcode log that is getting the 500 error? You may have to enable OneSignal verbose logging.

@FantaMagier
Copy link
Author

@jkasten2 I got the following logs:

VERBOSE: HTTP Request (OneSignalUser.OSRequestIdentifyUser) with URL: https://api.onesignal.com/apps/APPID/users/by/onesignal_id/ONESIGNALID/identity, with parameters: {
  "identity" : {
    "external_id" : "QON_54eb6b1ca96d419babc4efa1cfe3ed3e"
  }
}
[Sentry] [debug] [SentryNetworkTracker:390] Response status code isn't within the allowed ranges, not capturing HTTP Client errors.
VERBOSE: network response (OSRequestGetInAppMessages) with URL https://api.onesignal.com/apps/APPID/subscriptions/NUM/iams: {
    httpStatusCode = 200;
    "in_app_messages" =     (
    );
}
VERBOSE: getInAppMessagesFromServer success
VERBOSE: updateInAppMessagesFromServer
[Sentry] [debug] [SentryScope:125] Add breadcrumb: <SentryBreadcrumb: 0x3018df240, {
    category = http;
    data =     {
        method = GET;
        reason = "no error";
        "request_body_size" = 0;
        "response_body_size" = 22;
        "status_code" = 200;
        url = "https://api.onesignal.com/apps/APPID/subscriptions/SUBNUM/iams";
    };
    level = info;
    timestamp = "2024-07-19T04:08:19.108Z";
    type = http;
}>

@nan-li
Copy link
Contributor

nan-li commented Aug 8, 2024

Hi @FantaMagier, it seems your log cut out key information. I see the 200 success response the SDK makes to fetch in app messages from the server. I don't see the 500 error.

@jennantilla
Copy link
Contributor

Closing due to no response. @FantaMagier if this is still an issue on the latest SDK version, please provide an updated log with the 500 error and we'll be happy to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants