react-native-onesignal
Advanced tools
Comparing version 4.3.8 to 4.3.9
@@ -78,3 +78,3 @@ "use strict"; | ||
var addListenerCallback = function (payload) { | ||
if ((0, helpers_1.isMultipleInstancesPossible)(eventName)) { | ||
if (helpers_1.isMultipleInstancesPossible(eventName)) { | ||
// used for adders | ||
@@ -81,0 +81,0 @@ var handlerArray = _this.eventHandlerArrayMap.get(eventName); |
@@ -10,3 +10,3 @@ "use strict"; | ||
function isValidCallback(handler) { | ||
(0, invariant_1.default)(typeof handler === 'function', 'Must provide a valid callback'); | ||
invariant_1.default(typeof handler === 'function', 'Must provide a valid callback'); | ||
} | ||
@@ -13,0 +13,0 @@ exports.isValidCallback = isValidCallback; |
@@ -61,3 +61,3 @@ 'use strict'; | ||
OneSignal.setAppId = function (appId) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -73,5 +73,5 @@ RNOneSignal.setAppId(appId); | ||
OneSignal.addPermissionObserver = function (observer) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(observer); | ||
helpers_1.isValidCallback(observer); | ||
RNOneSignal.addPermissionObserver(); | ||
@@ -85,3 +85,3 @@ eventManager.addEventHandler(events_1.PERMISSION_CHANGED, observer); | ||
OneSignal.clearPermissionObservers = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -97,5 +97,5 @@ RNOneSignal.removePermissionObserver(); | ||
OneSignal.addSubscriptionObserver = function (observer) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(observer); | ||
helpers_1.isValidCallback(observer); | ||
RNOneSignal.addSubscriptionObserver(); | ||
@@ -109,3 +109,3 @@ eventManager.addEventHandler(events_1.SUBSCRIPTION_CHANGED, observer); | ||
OneSignal.clearSubscriptionObservers = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -121,5 +121,5 @@ RNOneSignal.removeSubscriptionObserver(); | ||
OneSignal.addEmailSubscriptionObserver = function (observer) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(observer); | ||
helpers_1.isValidCallback(observer); | ||
RNOneSignal.addEmailSubscriptionObserver(); | ||
@@ -133,3 +133,3 @@ eventManager.addEventHandler(events_1.EMAIL_SUBSCRIPTION_CHANGED, observer); | ||
OneSignal.clearEmailSubscriptionObservers = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -145,5 +145,5 @@ RNOneSignal.removeEmailSubscriptionObserver(); | ||
OneSignal.addSMSSubscriptionObserver = function (observer) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(observer); | ||
helpers_1.isValidCallback(observer); | ||
RNOneSignal.addSMSSubscriptionObserver(); | ||
@@ -157,3 +157,3 @@ eventManager.addEventHandler(events_1.SMS_SUBSCRIPTION_CHANGED, observer); | ||
OneSignal.clearSMSSubscriptionObservers = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -172,5 +172,5 @@ RNOneSignal.removeSMSSubscriptionObserver(); | ||
OneSignal.setNotificationWillShowInForegroundHandler = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(handler); | ||
helpers_1.isValidCallback(handler); | ||
RNOneSignal.setNotificationWillShowInForegroundHandler(); | ||
@@ -185,5 +185,5 @@ eventManager.setEventHandler(events_1.NOTIFICATION_WILL_SHOW, handler); | ||
OneSignal.setNotificationOpenedHandler = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(handler); | ||
helpers_1.isValidCallback(handler); | ||
RNOneSignal.setNotificationOpenedHandler(); | ||
@@ -199,6 +199,6 @@ eventManager.setEventHandler(events_1.NOTIFICATION_OPENED, handler); | ||
OneSignal.promptForPushNotificationsWithUserResponse = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
if (react_native_1.Platform.OS === 'ios') { | ||
(0, helpers_1.isValidCallback)(handler); | ||
helpers_1.isValidCallback(handler); | ||
RNOneSignal.promptForPushNotificationsWithUserResponse(handler); | ||
@@ -220,6 +220,6 @@ } | ||
OneSignal.registerForProvisionalAuthorization = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
if (react_native_1.Platform.OS === 'ios') { | ||
(0, helpers_1.isValidCallback)(handler); | ||
helpers_1.isValidCallback(handler); | ||
RNOneSignal.registerForProvisionalAuthorization(handler); | ||
@@ -237,3 +237,3 @@ } | ||
OneSignal.disablePush = function (disable) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -248,3 +248,3 @@ RNOneSignal.disablePush(disable); | ||
OneSignal.unsubscribeWhenNotificationsAreDisabled = function (unsubscribe) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -265,3 +265,3 @@ if (react_native_1.Platform.OS === 'android') { | ||
// must return a promise | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return Promise.resolve(false); | ||
@@ -276,3 +276,3 @@ return RNOneSignal.isLocationShared(); | ||
OneSignal.setLocationShared = function (shared) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -286,3 +286,3 @@ RNOneSignal.setLocationShared(shared); | ||
OneSignal.promptLocation = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -304,3 +304,3 @@ //Supported in both iOS & Android | ||
case 0: | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return [2 /*return*/, Promise.resolve(null)]; | ||
@@ -325,3 +325,3 @@ return [4 /*yield*/, RNOneSignal.getDeviceState()]; | ||
OneSignal.setLanguage = function (language) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -338,3 +338,3 @@ RNOneSignal.setLanguage(language); | ||
OneSignal.sendTag = function (key, value) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -352,3 +352,3 @@ if (!key || (!value && value !== "")) { | ||
OneSignal.sendTags = function (tags) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -367,3 +367,3 @@ var keys = Object.keys(tags); | ||
OneSignal.getTags = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -378,3 +378,3 @@ RNOneSignal.getTags(handler); | ||
OneSignal.deleteTag = function (key) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -391,3 +391,3 @@ if (typeof key !== "string") { | ||
OneSignal.deleteTags = function (keys) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -408,3 +408,3 @@ if (!Array.isArray(keys)) { | ||
OneSignal.setEmail = function (email, emailAuthCode, handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -423,3 +423,3 @@ if (emailAuthCode === undefined) | ||
OneSignal.logoutEmail = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -440,3 +440,3 @@ // Android workaround for the current issue of callback fired more than once | ||
OneSignal.setSMSNumber = function (smsNumber, smsAuthCode, handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -455,3 +455,3 @@ if (smsAuthCode === undefined) | ||
OneSignal.logoutSMSNumber = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -472,3 +472,3 @@ // Android workaround for the current issue of callback fired more than once | ||
OneSignal.postNotification = function (notificationObjectString, onSuccess, onFailure) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -486,3 +486,3 @@ if (!onSuccess) | ||
OneSignal.clearOneSignalNotifications = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -503,3 +503,3 @@ if (react_native_1.Platform.OS === 'android') { | ||
OneSignal.removeNotification = function (id) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -520,3 +520,3 @@ if (react_native_1.Platform.OS === 'android') { | ||
OneSignal.removeGroupedNotifications = function (id) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -536,3 +536,3 @@ if (react_native_1.Platform.OS === 'android') { | ||
OneSignal.setLaunchURLsInApp = function (isEnabled) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -555,3 +555,3 @@ if (react_native_1.Platform.OS === 'ios') { | ||
OneSignal.setExternalUserId = function (externalId, handlerOrAuth, handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -573,3 +573,3 @@ if (typeof handlerOrAuth === "function") { | ||
OneSignal.removeExternalUserId = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -588,5 +588,5 @@ // Android workaround for the current issue of callback fired more than once | ||
OneSignal.setInAppMessageClickHandler = function (handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
(0, helpers_1.isValidCallback)(handler); | ||
helpers_1.isValidCallback(handler); | ||
RNOneSignal.initInAppMessageClickHandlerParams(); | ||
@@ -602,18 +602,18 @@ RNOneSignal.setInAppMessageClickHandler(); | ||
OneSignal.setInAppMessageLifecycleHandler = function (handlerObject) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
if (handlerObject.onWillDisplayInAppMessage) { | ||
(0, helpers_1.isValidCallback)(handlerObject.onWillDisplayInAppMessage); | ||
helpers_1.isValidCallback(handlerObject.onWillDisplayInAppMessage); | ||
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_WILL_DISPLAY, handlerObject.onWillDisplayInAppMessage); | ||
} | ||
if (handlerObject.onDidDisplayInAppMessage) { | ||
(0, helpers_1.isValidCallback)(handlerObject.onDidDisplayInAppMessage); | ||
helpers_1.isValidCallback(handlerObject.onDidDisplayInAppMessage); | ||
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_DID_DISPLAY, handlerObject.onDidDisplayInAppMessage); | ||
} | ||
if (handlerObject.onWillDismissInAppMessage) { | ||
(0, helpers_1.isValidCallback)(handlerObject.onWillDismissInAppMessage); | ||
helpers_1.isValidCallback(handlerObject.onWillDismissInAppMessage); | ||
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_WILL_DISMISS, handlerObject.onWillDismissInAppMessage); | ||
} | ||
if (handlerObject.onDidDismissInAppMessage) { | ||
(0, helpers_1.isValidCallback)(handlerObject.onDidDismissInAppMessage); | ||
helpers_1.isValidCallback(handlerObject.onDidDismissInAppMessage); | ||
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_DID_DISMISS, handlerObject.onDidDismissInAppMessage); | ||
@@ -630,3 +630,3 @@ } | ||
OneSignal.addTrigger = function (key, value) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -647,3 +647,3 @@ // value can be assigned to `false` so we cannot just check `!value` | ||
OneSignal.addTriggers = function (triggers) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -662,3 +662,3 @@ var keys = Object.keys(triggers); | ||
OneSignal.removeTriggersForKeys = function (keys) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -673,3 +673,3 @@ RNOneSignal.removeTriggersForKeys(keys); | ||
OneSignal.removeTriggerForKey = function (key) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -685,3 +685,3 @@ RNOneSignal.removeTriggerForKey(key); | ||
// must return a promise | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return Promise.resolve(null); | ||
@@ -696,3 +696,3 @@ return RNOneSignal.getTriggerValueForKey(key); | ||
OneSignal.pauseInAppMessages = function (pause) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -709,3 +709,3 @@ RNOneSignal.pauseInAppMessages(pause); | ||
OneSignal.sendOutcome = function (name, handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -724,3 +724,3 @@ if (!handler) { | ||
OneSignal.sendUniqueOutcome = function (name, handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -741,3 +741,3 @@ if (!handler) { | ||
OneSignal.sendOutcomeWithValue = function (name, value, handler) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -755,3 +755,3 @@ if (!handler) { | ||
OneSignal.userProvidedPrivacyConsent = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return Promise.resolve(false); | ||
@@ -766,3 +766,3 @@ //returns a promise | ||
OneSignal.requiresUserPrivacyConsent = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return Promise.resolve(false); | ||
@@ -778,3 +778,3 @@ //returns a promise | ||
OneSignal.setRequiresUserPrivacyConsent = function (required) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -789,3 +789,3 @@ RNOneSignal.setRequiresUserPrivacyConsent(required); | ||
OneSignal.provideUserConsent = function (granted) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -802,3 +802,3 @@ RNOneSignal.provideUserConsent(granted); | ||
OneSignal.setLogLevel = function (nsLogLevel, visualLogLevel) { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -812,3 +812,3 @@ RNOneSignal.setLogLevel(nsLogLevel, visualLogLevel); | ||
OneSignal.clearHandlers = function () { | ||
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal)) | ||
if (!helpers_1.isNativeModuleLoaded(RNOneSignal)) | ||
return; | ||
@@ -815,0 +815,0 @@ eventManager.clearHandlers(); |
{ | ||
"name": "react-native-onesignal", | ||
"version": "4.3.8", | ||
"version": "4.3.9", | ||
"description": "React Native OneSignal SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
0
259112
60