Skip to content

Commit

Permalink
Update method deprecation warnings to include method names
Browse files Browse the repository at this point in the history
  • Loading branch information
jennantilla committed Mar 19, 2024
1 parent ced01ce commit 25e717a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ export namespace OneSignal {
}

/**
* @deprecated This method is deprecated. It has been replaced by {@link getIdAsync}.
* @deprecated getPushSubscriptionId is deprecated. It has been replaced by {@link getIdAsync}.
*/
export function getPushSubscriptionId(): string {
if (!isNativeModuleLoaded(RNOneSignal)) {
return '';
}
console.warn(
'OneSignal: This method has been deprecated. Use getIdAsync instead for getting push subscription id.',
'OneSignal: The method getPushSubscriptionId has been deprecated. Use getIdAsync instead for getting push subscription id.',
);

return pushSub.id ? pushSub.id : '';
Expand All @@ -244,14 +244,14 @@ export namespace OneSignal {
}

/**
* @deprecated This method is deprecated. It has been replaced by {@link getTokenAsync}.
* @deprecated getPushSubscriptionToken is deprecated. It has been replaced by {@link getTokenAsync}.
*/
export function getPushSubscriptionToken(): string {
if (!isNativeModuleLoaded(RNOneSignal)) {
return '';
}
console.warn(
'OneSignal: This method has been deprecated. Use getTokenAsync instead for getting push subscription token.',
'OneSignal: The method getPushSubscriptionToken has been deprecated. Use getTokenAsync instead for getting push subscription token.',
);

return pushSub.token ? pushSub.token : '';
Expand All @@ -269,14 +269,14 @@ export namespace OneSignal {
}

/**
* @deprecated This method is deprecated. It has been replaced by {@link getOptedInAsync}.
* @deprecated getOptedIn is deprecated. It has been replaced by {@link getOptedInAsync}.
*/
export function getOptedIn(): boolean {
if (!isNativeModuleLoaded(RNOneSignal)) {
return false;
}
console.warn(
'OneSignal: This method has been deprecated. Use getOptedInAsync instead for getting push subscription opted in status.',
'OneSignal: The method getOptedIn has been deprecated. Use getOptedInAsync instead for getting push subscription opted in status.',
);

return pushSub.optedIn;
Expand Down

0 comments on commit 25e717a

Please sign in to comment.