Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-onesignal

Package Overview
Dependencies
Maintainers
9
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-onesignal - npm Package Compare versions

Comparing version 4.3.10 to 4.3.11

.github/pull_request_template.md

2

dist/events/EventManager.js

@@ -78,3 +78,3 @@ "use strict";

var addListenerCallback = function (payload) {
if (helpers_1.isMultipleInstancesPossible(eventName)) {
if ((0, 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) {
invariant_1.default(typeof handler === 'function', 'Must provide a valid callback');
(0, invariant_1.default)(typeof handler === 'function', 'Must provide a valid callback');
}

@@ -13,0 +13,0 @@ exports.isValidCallback = isValidCallback;

@@ -125,5 +125,7 @@ import { DeviceState, ChangeEvent, PermissionChange, SubscriptionChange, EmailSubscriptionChange, SMSSubscriptionChange } from './models/Subscription';

* @param {string} language
* @param {(success:object) => void} onSuccess
* @param {(failure:object) => void} onFailure
* @returns void
*/
static setLanguage(language: string): void;
static setLanguage(language: string, onSuccess?: (success: object) => void, onFailure?: (failure: object) => void): void;
/**

@@ -130,0 +132,0 @@ * Tag a user based on an app event of your choosing so they can be targeted later via segments.

@@ -61,3 +61,3 @@ 'use strict';

OneSignal.setAppId = function (appId) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -73,5 +73,5 @@ RNOneSignal.setAppId(appId);

OneSignal.addPermissionObserver = function (observer) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(observer);
(0, helpers_1.isValidCallback)(observer);
RNOneSignal.addPermissionObserver();

@@ -85,3 +85,3 @@ eventManager.addEventHandler(events_1.PERMISSION_CHANGED, observer);

OneSignal.clearPermissionObservers = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -97,5 +97,5 @@ RNOneSignal.removePermissionObserver();

OneSignal.addSubscriptionObserver = function (observer) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(observer);
(0, helpers_1.isValidCallback)(observer);
RNOneSignal.addSubscriptionObserver();

@@ -109,3 +109,3 @@ eventManager.addEventHandler(events_1.SUBSCRIPTION_CHANGED, observer);

OneSignal.clearSubscriptionObservers = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -121,5 +121,5 @@ RNOneSignal.removeSubscriptionObserver();

OneSignal.addEmailSubscriptionObserver = function (observer) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(observer);
(0, helpers_1.isValidCallback)(observer);
RNOneSignal.addEmailSubscriptionObserver();

@@ -133,3 +133,3 @@ eventManager.addEventHandler(events_1.EMAIL_SUBSCRIPTION_CHANGED, observer);

OneSignal.clearEmailSubscriptionObservers = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -145,5 +145,5 @@ RNOneSignal.removeEmailSubscriptionObserver();

OneSignal.addSMSSubscriptionObserver = function (observer) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(observer);
(0, helpers_1.isValidCallback)(observer);
RNOneSignal.addSMSSubscriptionObserver();

@@ -157,3 +157,3 @@ eventManager.addEventHandler(events_1.SMS_SUBSCRIPTION_CHANGED, observer);

OneSignal.clearSMSSubscriptionObservers = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -172,5 +172,5 @@ RNOneSignal.removeSMSSubscriptionObserver();

OneSignal.setNotificationWillShowInForegroundHandler = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(handler);
(0, helpers_1.isValidCallback)(handler);
RNOneSignal.setNotificationWillShowInForegroundHandler();

@@ -185,5 +185,5 @@ eventManager.setEventHandler(events_1.NOTIFICATION_WILL_SHOW, handler);

OneSignal.setNotificationOpenedHandler = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(handler);
(0, helpers_1.isValidCallback)(handler);
RNOneSignal.setNotificationOpenedHandler();

@@ -199,6 +199,6 @@ eventManager.setEventHandler(events_1.NOTIFICATION_OPENED, handler);

OneSignal.promptForPushNotificationsWithUserResponse = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
if (react_native_1.Platform.OS === 'ios') {
helpers_1.isValidCallback(handler);
(0, helpers_1.isValidCallback)(handler);
RNOneSignal.promptForPushNotificationsWithUserResponse(handler);

@@ -220,6 +220,6 @@ }

OneSignal.registerForProvisionalAuthorization = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
if (react_native_1.Platform.OS === 'ios') {
helpers_1.isValidCallback(handler);
(0, helpers_1.isValidCallback)(handler);
RNOneSignal.registerForProvisionalAuthorization(handler);

@@ -237,3 +237,3 @@ }

OneSignal.disablePush = function (disable) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -248,3 +248,3 @@ RNOneSignal.disablePush(disable);

OneSignal.unsubscribeWhenNotificationsAreDisabled = function (unsubscribe) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -265,3 +265,3 @@ if (react_native_1.Platform.OS === 'android') {

// must return a promise
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return Promise.resolve(false);

@@ -276,3 +276,3 @@ return RNOneSignal.isLocationShared();

OneSignal.setLocationShared = function (shared) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -286,3 +286,3 @@ RNOneSignal.setLocationShared(shared);

OneSignal.promptLocation = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -304,3 +304,3 @@ //Supported in both iOS & Android

case 0:
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return [2 /*return*/, Promise.resolve(null)];

@@ -322,8 +322,16 @@ return [4 /*yield*/, RNOneSignal.getDeviceState()];

* @param {string} language
* @param {(success:object) => void} onSuccess
* @param {(failure:object) => void} onFailure
* @returns void
*/
OneSignal.setLanguage = function (language) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
OneSignal.setLanguage = function (language, onSuccess, onFailure) {
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
RNOneSignal.setLanguage(language);
if (!onSuccess) {
onSuccess = function () { };
}
if (!onFailure) {
onFailure = function () { };
}
RNOneSignal.setLanguage(language, onSuccess, onFailure);
};

@@ -338,3 +346,3 @@ /* T A G S */

OneSignal.sendTag = function (key, value) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -352,3 +360,3 @@ if (!key || (!value && value !== "")) {

OneSignal.sendTags = function (tags) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -367,3 +375,3 @@ var keys = Object.keys(tags);

OneSignal.getTags = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -378,3 +386,3 @@ RNOneSignal.getTags(handler);

OneSignal.deleteTag = function (key) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -391,3 +399,3 @@ if (typeof key !== "string") {

OneSignal.deleteTags = function (keys) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -408,3 +416,3 @@ if (!Array.isArray(keys)) {

OneSignal.setEmail = function (email, emailAuthCode, handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -423,3 +431,3 @@ if (emailAuthCode === undefined)

OneSignal.logoutEmail = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -440,3 +448,3 @@ // Android workaround for the current issue of callback fired more than once

OneSignal.setSMSNumber = function (smsNumber, smsAuthCode, handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -455,3 +463,3 @@ if (smsAuthCode === undefined)

OneSignal.logoutSMSNumber = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -472,3 +480,3 @@ // Android workaround for the current issue of callback fired more than once

OneSignal.postNotification = function (notificationObjectString, onSuccess, onFailure) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -486,3 +494,3 @@ if (!onSuccess)

OneSignal.clearOneSignalNotifications = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -503,3 +511,3 @@ if (react_native_1.Platform.OS === 'android') {

OneSignal.removeNotification = function (id) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -520,3 +528,3 @@ if (react_native_1.Platform.OS === 'android') {

OneSignal.removeGroupedNotifications = function (id) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -536,3 +544,3 @@ if (react_native_1.Platform.OS === 'android') {

OneSignal.setLaunchURLsInApp = function (isEnabled) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -555,3 +563,3 @@ if (react_native_1.Platform.OS === 'ios') {

OneSignal.setExternalUserId = function (externalId, handlerOrAuth, handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -573,3 +581,3 @@ if (typeof handlerOrAuth === "function") {

OneSignal.removeExternalUserId = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -588,5 +596,5 @@ // Android workaround for the current issue of callback fired more than once

OneSignal.setInAppMessageClickHandler = function (handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
helpers_1.isValidCallback(handler);
(0, helpers_1.isValidCallback)(handler);
RNOneSignal.initInAppMessageClickHandlerParams();

@@ -602,18 +610,18 @@ RNOneSignal.setInAppMessageClickHandler();

OneSignal.setInAppMessageLifecycleHandler = function (handlerObject) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;
if (handlerObject.onWillDisplayInAppMessage) {
helpers_1.isValidCallback(handlerObject.onWillDisplayInAppMessage);
(0, helpers_1.isValidCallback)(handlerObject.onWillDisplayInAppMessage);
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_WILL_DISPLAY, handlerObject.onWillDisplayInAppMessage);
}
if (handlerObject.onDidDisplayInAppMessage) {
helpers_1.isValidCallback(handlerObject.onDidDisplayInAppMessage);
(0, helpers_1.isValidCallback)(handlerObject.onDidDisplayInAppMessage);
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_DID_DISPLAY, handlerObject.onDidDisplayInAppMessage);
}
if (handlerObject.onWillDismissInAppMessage) {
helpers_1.isValidCallback(handlerObject.onWillDismissInAppMessage);
(0, helpers_1.isValidCallback)(handlerObject.onWillDismissInAppMessage);
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_WILL_DISMISS, handlerObject.onWillDismissInAppMessage);
}
if (handlerObject.onDidDismissInAppMessage) {
helpers_1.isValidCallback(handlerObject.onDidDismissInAppMessage);
(0, helpers_1.isValidCallback)(handlerObject.onDidDismissInAppMessage);
eventManager.setEventHandler(events_1.IN_APP_MESSAGE_DID_DISMISS, handlerObject.onDidDismissInAppMessage);

@@ -630,3 +638,3 @@ }

OneSignal.addTrigger = function (key, value) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -647,3 +655,3 @@ // value can be assigned to `false` so we cannot just check `!value`

OneSignal.addTriggers = function (triggers) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -662,3 +670,3 @@ var keys = Object.keys(triggers);

OneSignal.removeTriggersForKeys = function (keys) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -673,3 +681,3 @@ RNOneSignal.removeTriggersForKeys(keys);

OneSignal.removeTriggerForKey = function (key) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -685,3 +693,3 @@ RNOneSignal.removeTriggerForKey(key);

// must return a promise
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return Promise.resolve(null);

@@ -696,3 +704,3 @@ return RNOneSignal.getTriggerValueForKey(key);

OneSignal.pauseInAppMessages = function (pause) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -709,3 +717,3 @@ RNOneSignal.pauseInAppMessages(pause);

OneSignal.sendOutcome = function (name, handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -724,3 +732,3 @@ if (!handler) {

OneSignal.sendUniqueOutcome = function (name, handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -741,3 +749,3 @@ if (!handler) {

OneSignal.sendOutcomeWithValue = function (name, value, handler) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -755,3 +763,3 @@ if (!handler) {

OneSignal.userProvidedPrivacyConsent = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return Promise.resolve(false);

@@ -766,3 +774,3 @@ //returns a promise

OneSignal.requiresUserPrivacyConsent = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return Promise.resolve(false);

@@ -778,3 +786,3 @@ //returns a promise

OneSignal.setRequiresUserPrivacyConsent = function (required) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -789,3 +797,3 @@ RNOneSignal.setRequiresUserPrivacyConsent(required);

OneSignal.provideUserConsent = function (granted) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -802,3 +810,3 @@ RNOneSignal.provideUserConsent(granted);

OneSignal.setLogLevel = function (nsLogLevel, visualLogLevel) {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -812,3 +820,3 @@ RNOneSignal.setLogLevel(nsLogLevel, visualLogLevel);

OneSignal.clearHandlers = function () {
if (!helpers_1.isNativeModuleLoaded(RNOneSignal))
if (!(0, helpers_1.isNativeModuleLoaded)(RNOneSignal))
return;

@@ -815,0 +823,0 @@ eventManager.clearHandlers();

{
"name": "react-native-onesignal",
"version": "4.3.10",
"version": "4.3.11",
"description": "React Native OneSignal SDK",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -290,8 +290,17 @@ 'use strict';

* @param {string} language
* @param {(success:object) => void} onSuccess
* @param {(failure:object) => void} onFailure
* @returns void
*/
static setLanguage(language: string): void {
static setLanguage(language: string, onSuccess?: (success: object) => void, onFailure?: (failure: object) => void): void {
if (!isNativeModuleLoaded(RNOneSignal)) return;
RNOneSignal.setLanguage(language);
if (!onSuccess) {
onSuccess = function(){};
}
if (!onFailure) {
onFailure = function(){};
}
RNOneSignal.setLanguage(language, onSuccess, onFailure);
}

@@ -298,0 +307,0 @@

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc