react-native-onesignal
Advanced tools
Comparing version 4.0.0-beta.5 to 4.0.0
{ | ||
"name": "react-native-onesignal", | ||
"version": "4.0.0-beta.5", | ||
"version": "4.0.0", | ||
"description": "React Native OneSignal SDK", | ||
@@ -5,0 +5,0 @@ "main": "src/index", |
@@ -6,3 +6,3 @@ declare module 'react-native-onesignal' { | ||
// 0 = NotDetermined, 1 = Authorized, 2 = Denied, 3 = Provisional, 4 = Ephemeral | ||
// 0 = NotDetermined, 1 = Denied, 2 = Authorized, 3 = Provisional, 4 = Ephemeral | ||
export type IosPermissionStatus = 0 | 1 | 2 | 3 | 4; | ||
@@ -261,3 +261,3 @@ | ||
*/ | ||
postNotification(notificationObjectString: string, onSuccess: (success: object) => void, onFailure: (failure: object) => void): void; | ||
postNotification(notificationObjectString: string, onSuccess?: (success: object) => void, onFailure?: (failure: object) => void): void; | ||
@@ -271,7 +271,7 @@ /** | ||
/** | ||
* Cancels a single OneSignal notification based on its Android notification integer id. | ||
* Removes a single OneSignal notification based on its Android notification integer id. | ||
* @param {number} id - notification id to cancel | ||
* @returns void | ||
*/ | ||
cancelNotification(id: number): void; | ||
removeNotification(id: number): void; | ||
@@ -284,3 +284,3 @@ /** | ||
*/ | ||
setExternalUserId(externalId: string, handler?: (results: object) => void): void; | ||
setExternalUserId(externalId: string, handlerOrAuth?: ((results: object) => void) | string, handler?: (results: object) => void): void; | ||
@@ -287,0 +287,0 @@ /** |
@@ -139,3 +139,3 @@ 'use strict'; | ||
if (!key || !value) { | ||
if (!key || (!value && value !== "")) { | ||
console.error("OneSignal: sendTag: must include a key and a value"); | ||
@@ -207,3 +207,6 @@ } | ||
if (!checkIfInitialized(RNOneSignal)) return; | ||
isValidCallback(handler); | ||
if (!handler) | ||
handler = function(){}; | ||
RNOneSignal.logoutEmail(handler); | ||
@@ -214,4 +217,11 @@ } | ||
static postNotification(notificationObjectString, onSuccess=()=>{}, onFailure=()=>{}) { | ||
static postNotification(notificationObjectString, onSuccess, onFailure) { | ||
if (!checkIfInitialized(RNOneSignal)) return; | ||
if (!onSuccess) | ||
onSuccess = function(){}; | ||
if (!onFailure) | ||
onFailure = function(){}; | ||
RNOneSignal.postNotification(notificationObjectString, onSuccess, onFailure); | ||
@@ -242,9 +252,11 @@ } | ||
static setExternalUserId(externalId, handler) { | ||
static setExternalUserId(externalId, varArg1, varArg2) { | ||
if (!checkIfInitialized(RNOneSignal)) return; | ||
if (handler === undefined) | ||
handler = function(){}; | ||
if (typeof varArg1 === "function") { | ||
RNOneSignal.setExternalUserId(externalId, null, varArg1); | ||
return; | ||
} | ||
RNOneSignal.setExternalUserId(externalId, handler); | ||
RNOneSignal.setExternalUserId(externalId, varArg1, varArg2 || function(){}); | ||
} | ||
@@ -251,0 +263,0 @@ |
@@ -29,3 +29,3 @@ import { Platform } from 'react-native'; | ||
if (Platform.OS = 'ios') { | ||
if (Platform.OS === 'ios') { | ||
this.badge = receivedEvent.badge; | ||
@@ -43,2 +43,2 @@ this.category = receivedEvent.category; | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1517
2
0
171081
36