Skip to content

Commit

Permalink
Merge pull request #697 from OneSignal/fix/iOSNullPushSubIdAndToken
Browse files Browse the repository at this point in the history
[Fix] iOS Null PushSubscription Id and Token crash
  • Loading branch information
shepherd-l authored and jinliu9508 committed Feb 27, 2024
2 parents 18c7028 + 051877e commit 12cd18e
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 12cd18e

Please sign in to comment.