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

[Fix] iOS Null PushSubscription Id and Token crash #697

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions OneSignalExample/Assets/OneSignal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- iOS crash when calling OneSignal.User.PushSubscription.Id and OneSignal.User.PushSubscription.Token when they are null.

## [5.0.6]
### Fixed
- Duplicate symbol errors when building with other iOS plugins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,16 @@ void _oneSignalUserRemoveTags(const char* tagsJson) {
}

const char* _oneSignalPushSubscriptionGetId() {
if (OneSignal.User.pushSubscription.id == NULL) {
return NULL;
}
return strdup([OneSignal.User.pushSubscription.id UTF8String]);
}

const char* _oneSignalPushSubscriptionGetToken() {
if (OneSignal.User.pushSubscription.token == NULL) {
return NULL;
}
return strdup([OneSignal.User.pushSubscription.token UTF8String]);
}

Expand Down
Loading