Skip to content

[question]: IdsAvailable deprecated SPM in Objective-C #1479

@salvatoreboemia

Description

@salvatoreboemia

How can we help?

Hi

I'm trying to build an old project with Xcode 16

Version Installed: 5.2.4 SPM

Code affected:

[OneSignal IdsAvailable:^(NSString* userId, NSString* pushToken) 
No known class method for selector 'IdsAvailable:'

Changed import with from this to this

#import <OneSignalFramework/OneSignalFramework.h>
to
#import <OneSignal/OneSignal.h>

Could you provide me with some examples of how to replace this deprecated method? I tried also getDeviceState and so on but no works

Thanks

Code of Conduct

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

EDIT

I tried in this way:

NSString* userId = OneSignal.User.pushSubscription.id;
NSString* pushToken = OneSignal.User.pushSubscription.token;
    
    if (userId != nil) {
        NSLog(@"OneSignal UserId: %@", userId);
        // todo
        if (pushToken != nil) {
            NSLog(@"OneSignal pushToken: %@", pushToken);
            
     // todo
        }
    }

But I don't know if is the correct replacement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions