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

onesignal-expo-plugin

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onesignal-expo-plugin - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

18

build/onesignal/withOneSignalAndroid.js

@@ -8,23 +8,7 @@ "use strict";

exports.withOneSignalAndroid = void 0;
const config_plugins_1 = require("@expo/config-plugins");
const androidConstants_1 = require("../support/androidConstants");
const OneSignalLog_1 = require("../support/OneSignalLog");
const withGradleBuildConfig = (config) => {
return (0, config_plugins_1.withAppBuildGradle)(config, (newConfig) => {
let { contents } = newConfig.modResults;
// make sure we haven't previously added dependencies
if (!contents.includes(androidConstants_1.ONESIGNAL_GRADLE)) {
contents = `${androidConstants_1.ONESIGNAL_GRADLE}\n${contents}`;
}
else {
OneSignalLog_1.OneSignalLog.log("OneSignal dependencies already added to build.gradle. Skipping...");
}
newConfig.modResults.contents = contents;
return newConfig;
});
};
const withOneSignalAndroid = (config, props) => {
withGradleBuildConfig(config, props);
OneSignalLog_1.OneSignalLog.log("No specific actions required for OneSignal on Android...");
return config;
};
exports.withOneSignalAndroid = withOneSignalAndroid;

8

build/onesignal/withOneSignalIos.js

@@ -106,3 +106,9 @@ "use strict";

};
xcodeProjectAddNse(props.modRequest.projectName || "", options, "node_modules/onesignal-expo-plugin/build/support/serviceExtensionFiles/");
// support for monorepos where node_modules can be up to 5 parents
// above the project directory.
let dir = "node_modules";
for (let x = 0; x < 5 && !FileManager_1.FileManager.dirExists(dir); x++) {
dir = "../" + dir;
}
xcodeProjectAddNse(props.modRequest.projectName || "", options, dir + "/onesignal-expo-plugin/build/support/serviceExtensionFiles/");
return props;

@@ -109,0 +115,0 @@ });

@@ -57,3 +57,6 @@ "use strict";

}
static dirExists(path) {
return fs.existsSync(path);
}
}
exports.FileManager = FileManager;

@@ -6,23 +6,6 @@ /**

import { ConfigPlugin, withAppBuildGradle } from '@expo/config-plugins';
import { ONESIGNAL_GRADLE } from '../support/androidConstants';
import { ConfigPlugin } from '@expo/config-plugins';
import { OneSignalLog } from '../support/OneSignalLog';
import { OneSignalPluginProps } from '../types/types';
const withGradleBuildConfig: ConfigPlugin<OneSignalPluginProps> = (config) => {
return withAppBuildGradle(config, (newConfig) => {
let { contents } = newConfig.modResults;
// make sure we haven't previously added dependencies
if (!contents.includes(ONESIGNAL_GRADLE)) {
contents = `${ONESIGNAL_GRADLE}\n${contents}`;
} else {
OneSignalLog.log("OneSignal dependencies already added to build.gradle. Skipping...");
}
newConfig.modResults.contents = contents;
return newConfig;
});
};
export const withOneSignalAndroid: ConfigPlugin<OneSignalPluginProps> = (

@@ -32,5 +15,5 @@ config,

) => {
withGradleBuildConfig(config, props);
OneSignalLog.log("No specific actions required for OneSignal on Android...");
return config;
};

@@ -108,6 +108,13 @@ /**

// support for monorepos where node_modules can be up to 5 parents
// above the project directory.
let dir = "node_modules"
for(let x=0; x < 5 && !FileManager.dirExists(dir); x++) {
dir = "../" + dir
}
xcodeProjectAddNse(
props.modRequest.projectName || "",
options,
"node_modules/onesignal-expo-plugin/build/support/serviceExtensionFiles/"
dir + "/onesignal-expo-plugin/build/support/serviceExtensionFiles/"
);

@@ -114,0 +121,0 @@

{
"name": "onesignal-expo-plugin",
"version": "1.0.2",
"version": "1.1.0",
"description": "The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.",

@@ -5,0 +5,0 @@ "main": "./app.plugin.js",

<h1 align="center">Welcome to onesignal-expo-plugin 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.1-blue.svg?cacheSeconds=2592000" />
<a href="https://www.npmjs.com/package/onesignal-expo-plugin" target="_blank">
<img alt="Version" src="https://img.shields.io/npm/v/onesignal-expo-plugin.svg">
</a>
<a href="https://github.com/OneSignal/onesignal-expo-plugin#readme" target="_blank">

@@ -44,3 +46,3 @@ <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />

### Plugin
Add the plugin to the [plugin array](https://docs.expo.dev/versions/latest/config/app/):
Add the plugin to the **front** of the [plugin array](https://docs.expo.dev/versions/latest/config/app/). It should be added automatically if you ran `expo install`. Just make sure it is the first plugin in the array and to configure any desired plugin props:

@@ -178,3 +180,3 @@ **app.json**

Copyright © 2021 [OneSignal](https://github.com/OneSignal).<br />
Copyright © 2022 [OneSignal](https://github.com/OneSignal).<br />
This project is [MIT](https://github.com/OneSignal/onesignal-expo-plugin/blob/main/LICENSE) licensed.

@@ -38,2 +38,6 @@ import * as fs from 'fs';

}
static dirExists(path: string): boolean {
return fs.existsSync(path)
}
}
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