Skip to content

[Bug]: OneSignal.User.pushSubscription.id is null! #766

Open
@aydemiromer

Description

@aydemiromer

What happened?

I can't access subscriptionId , I want to use rest api in my app but I need subscriptionId for specific notification. I tried with copy subs id one signal panel thats runned not have a problem in my code, but inside the code not access have a directly subs id.

Steps to reproduce?

This is my code => 

 OneSignal.initialize(Env.oneSignal);
    OneSignal.login(token ?? '');
    var sendTags = {
      'deviceLanguage': deviceLang,
      'deviceCountry': deviceCountry,
      'status': 'free'
    };
    OneSignal.User.addTags(sendTags);

    print(OneSignal.User.pushSubscription.id);

What did you expect to happen?

Easily access subs id

OneSignal Flutter SDK version

5.0.3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions