onesignal-expo-plugin
Advanced tools
Comparing version 1.0.0-beta8 to 1.0.0-beta9
@@ -70,3 +70,9 @@ "use strict"; | ||
var _a; | ||
xcodeProjectAddNse(props.modRequest.projectName || "", props.modRequest.platformProjectRoot, ((_a = props.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier) || "", onesignalProps === null || onesignalProps === void 0 ? void 0 : onesignalProps.devTeam, "node_modules/onesignal-expo-plugin/build/support/serviceExtensionFiles/"); | ||
const options = { | ||
iosPath: props.modRequest.platformProjectRoot, | ||
bundleIdentifier: (_a = props.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier, | ||
devTeam: onesignalProps === null || onesignalProps === void 0 ? void 0 : onesignalProps.devTeam, | ||
iPhoneDeploymentTarget: onesignalProps === null || onesignalProps === void 0 ? void 0 : onesignalProps.iPhoneDeploymentTarget | ||
}; | ||
xcodeProjectAddNse(props.modRequest.projectName || "", options, "node_modules/onesignal-expo-plugin/build/support/serviceExtensionFiles/"); | ||
return props; | ||
@@ -84,3 +90,4 @@ }); | ||
exports.withOneSignalIos = withOneSignalIos; | ||
function xcodeProjectAddNse(appName, iosPath, bundleIdentifier, devTeam, sourceDir) { | ||
function xcodeProjectAddNse(appName, options, sourceDir) { | ||
const { iosPath, devTeam, bundleIdentifier, iPhoneDeploymentTarget } = options; | ||
(0, updatePodfile_1.updatePodfile)(iosPath); | ||
@@ -149,3 +156,3 @@ (0, updateNSEEntitlements_1.updateNSEEntitlements)(`group.${bundleIdentifier}.onesignal`); | ||
buildSettingsObj.DEVELOPMENT_TEAM = devTeam; | ||
buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = iosConstants_1.IPHONEOS_DEPLOYMENT_TARGET; | ||
buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = iPhoneDeploymentTarget !== null && iPhoneDeploymentTarget !== void 0 ? iPhoneDeploymentTarget : iosConstants_1.IPHONEOS_DEPLOYMENT_TARGET; | ||
buildSettingsObj.TARGETED_DEVICE_FAMILY = iosConstants_1.TARGETED_DEVICE_FAMILY; | ||
@@ -152,0 +159,0 @@ buildSettingsObj.CODE_SIGN_ENTITLEMENTS = `${targetName}/${targetName}.entitlements`; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = exports.NSE_PODFILE_REGEX = exports.NSE_PODFILE_SNIPPET = exports.TARGETED_DEVICE_FAMILY = exports.IPHONEOS_DEPLOYMENT_TARGET = void 0; | ||
exports.IPHONEOS_DEPLOYMENT_TARGET = "10.0"; | ||
exports.IPHONEOS_DEPLOYMENT_TARGET = "11.0"; | ||
exports.TARGETED_DEVICE_FAMILY = `\"1,2\"`; | ||
@@ -6,0 +6,0 @@ exports.NSE_PODFILE_SNIPPET = ` |
@@ -14,2 +14,8 @@ "use strict"; | ||
// even if your .xcodeproj is correct. | ||
(0, withOneSignalIos_1.xcodeProjectAddNse)("XcodeTestProj", ".", "com.onesignal.XcodeTestProj", "99SW8E36CT", "../../repos/onesignal-expo-plugin/support/serviceExtensionFiles/"); | ||
const options = { | ||
iosPath: '.', | ||
bundleIdentifier: "com.onesignal.XcodeTestProj", | ||
devTeam: "99SW8E36CT", | ||
iPhoneDeploymentTarget: '12.0' | ||
}; | ||
(0, withOneSignalIos_1.xcodeProjectAddNse)("XcodeTestProj", options, "../../repos/onesignal-expo-plugin/support/serviceExtensionFiles/"); |
@@ -15,4 +15,4 @@ /** | ||
mode: string; | ||
iOsBundleIdentifier: string; | ||
devTeam: string; | ||
iPhoneDeploymentTarget: string; | ||
}; | ||
@@ -19,0 +19,0 @@ |
@@ -19,2 +19,10 @@ /** | ||
/* I N T E R F A C E S */ | ||
interface PluginOptions { | ||
iosPath: string, | ||
devTeam?: string, | ||
bundleIdentifier?: string, | ||
iPhoneDeploymentTarget?: string | ||
} | ||
// ---------- ---------- ---------- ---------- | ||
@@ -87,7 +95,12 @@ | ||
return withXcodeProject(config, async props => { | ||
const options: PluginOptions = { | ||
iosPath: props.modRequest.platformProjectRoot, | ||
bundleIdentifier: props.ios?.bundleIdentifier, | ||
devTeam: onesignalProps?.devTeam, | ||
iPhoneDeploymentTarget: onesignalProps?.iPhoneDeploymentTarget | ||
}; | ||
xcodeProjectAddNse( | ||
props.modRequest.projectName || "", | ||
props.modRequest.platformProjectRoot, | ||
props.ios?.bundleIdentifier || "", | ||
onesignalProps?.devTeam, | ||
options, | ||
"node_modules/onesignal-expo-plugin/build/support/serviceExtensionFiles/" | ||
@@ -115,7 +128,7 @@ ); | ||
appName: string, | ||
iosPath: string, | ||
bundleIdentifier: string, | ||
devTeam: string | undefined, | ||
options: PluginOptions, | ||
sourceDir: string | ||
): void { | ||
const { iosPath, devTeam, bundleIdentifier, iPhoneDeploymentTarget } = options; | ||
updatePodfile(iosPath); | ||
@@ -212,3 +225,3 @@ updateNSEEntitlements(`group.${bundleIdentifier}.onesignal`) | ||
buildSettingsObj.DEVELOPMENT_TEAM = devTeam; | ||
buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = IPHONEOS_DEPLOYMENT_TARGET; | ||
buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = iPhoneDeploymentTarget ?? IPHONEOS_DEPLOYMENT_TARGET; | ||
buildSettingsObj.TARGETED_DEVICE_FAMILY = TARGETED_DEVICE_FAMILY; | ||
@@ -215,0 +228,0 @@ buildSettingsObj.CODE_SIGN_ENTITLEMENTS = `${targetName}/${targetName}.entitlements`; |
{ | ||
"name": "onesignal-expo-plugin", | ||
"version": "1.0.0-beta8", | ||
"version": "1.0.0-beta9", | ||
"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.0--beta7-blue.svg?cacheSeconds=2592000" /> | ||
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0--beta9-blue.svg?cacheSeconds=2592000" /> | ||
<a href="https://github.com/OneSignal/onesignal-expo-plugin#readme" target="_blank"> | ||
@@ -35,2 +35,3 @@ <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" /> | ||
expo install onesignal-expo-plugin | ||
yarn add react-native-onesignal | ||
``` | ||
@@ -50,3 +51,2 @@ | ||
"mode": "development", | ||
"devTeam": "91SW8A37CR" | ||
} | ||
@@ -68,4 +68,3 @@ ] | ||
{ | ||
mode: process.env.NODE_ENV || "development", | ||
devTeam: "91SW8A37CR" | ||
mode: "development", | ||
} | ||
@@ -77,8 +76,11 @@ ] | ||
#### Plugin Options | ||
* `mode`: used to configure [APNs environment](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment) entitlement. | ||
- `"development"` | ||
- `"production"` | ||
* `devTeam`: *optional* - used to configure Apple Team ID. You can find your Apple Team ID by running `expo credentials:manager`. | ||
#### Plugin Prop | ||
You can pass props to the plugin config object to configure: | ||
| Plugin Prop | | | | ||
|--------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `mode` | **required** | Used to configure [APNs environment](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment) entitlement. `"development"` or `"production"` | | ||
| `devTeam` | optional | Used to configure Apple Team ID. You can find your Apple Team ID by running `expo credentials:manager` e.g: `"91SW8A37CR"` | | ||
| `iPhoneDeploymentTarget` | optional | Target `IPHONEOS_DEPLOYMENT_TARGET` value to be used when adding the iOS [NSE](https://documentation.onesignal.com/docs/service-extensions). A deployment target is nothing more than the minimum version of the operating system the application can run on. This value should match the value in your Podfile e.g: `"12.0"`. | | ||
### OneSignal App ID | ||
@@ -112,3 +114,3 @@ Add your OneSignal App ID to your [Expo constants via the `extra` param](https://docs.expo.dev/versions/latest/config/app/): | ||
```sh | ||
$ expo prebuild | ||
$ expo prebuild --clean | ||
@@ -115,0 +117,0 @@ # Build your native iOS project |
@@ -1,2 +0,2 @@ | ||
export const IPHONEOS_DEPLOYMENT_TARGET = "10.0"; | ||
export const IPHONEOS_DEPLOYMENT_TARGET = "11.0"; | ||
export const TARGETED_DEVICE_FAMILY = `\"1,2\"`; | ||
@@ -3,0 +3,0 @@ |
@@ -14,8 +14,14 @@ import { xcodeProjectAddNse } from "./onesignal/withOneSignalIos"; | ||
// even if your .xcodeproj is correct. | ||
const options = { | ||
iosPath: '.', | ||
bundleIdentifier: "com.onesignal.XcodeTestProj", | ||
devTeam: "99SW8E36CT", | ||
iPhoneDeploymentTarget: '12.0' | ||
}; | ||
xcodeProjectAddNse( | ||
"XcodeTestProj", | ||
".", | ||
"com.onesignal.XcodeTestProj", | ||
"99SW8E36CT", | ||
"XcodeTestProj", | ||
options, | ||
"../../repos/onesignal-expo-plugin/support/serviceExtensionFiles/" | ||
); | ||
); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42754
685
140
0