OneSignal-iOS-SDK
OneSignal-iOS-SDK copied to clipboard
[question]: IdsAvailable deprecated SPM in Objective-C
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
- [X] 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