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

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

Open
1 task done
salvatoreboemia opened this issue Sep 11, 2024 · 0 comments
Open
1 task done

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

salvatoreboemia opened this issue Sep 11, 2024 · 0 comments

Comments

@salvatoreboemia
Copy link

salvatoreboemia commented Sep 11, 2024

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

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

1 participant