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

WIP: Fix: Documentation Updates #1668

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
export namespace User {
export namespace pushSubscription {
/** Add a callback that fires when the OneSignal subscription state changes. */
export function addEventListener(

Check warning on line 198 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

'addEventListener' is already declared in the upper scope on line 320 column 21
event: 'change',
listener: (event: PushSubscriptionChangedState) => void,
) {
Expand All @@ -210,7 +210,7 @@
}

/** Clears current subscription observers. */
export function removeEventListener(

Check warning on line 213 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

'removeEventListener' is already declared in the upper scope on line 335 column 21
event: 'change',
listener: (event: PushSubscriptionChangedState) => void,
) {
Expand All @@ -220,14 +220,14 @@
}

/**
* @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 @@
}

/**
* @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 @@
}

/**
* @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
Loading