onesignal-expo-plugin 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/release-drafter.yml +27 -0
- package/.github/workflows/Zapier.yml +29 -0
- package/.github/workflows/release-drafter.yml +42 -0
- package/CHANGELOG.md +5 -0
- package/EAS.md +1 -1
- package/README.md +13 -12
- package/build/onesignal/withOneSignalIos.js +4 -7
- package/onesignal/withOneSignalIos.ts +4 -7
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name-template: $RESOLVED_VERSION
|
|
2
|
+
tag-template: $RESOLVED_VERSION
|
|
3
|
+
categories:
|
|
4
|
+
- title: 🚀 Features
|
|
5
|
+
label: Enhancement / Feature
|
|
6
|
+
- title: 🐛 Bug Fixes
|
|
7
|
+
label: Bug
|
|
8
|
+
- title: 🧰 Improvements
|
|
9
|
+
label: Improvement
|
|
10
|
+
- title: down arrow Dependency Updates
|
|
11
|
+
label: Dependencies
|
|
12
|
+
change-template: '- $TITLE (#$NUMBER)'
|
|
13
|
+
version-resolver:
|
|
14
|
+
major:
|
|
15
|
+
labels:
|
|
16
|
+
- 'major'
|
|
17
|
+
minor:
|
|
18
|
+
labels:
|
|
19
|
+
- 'minor'
|
|
20
|
+
patch:
|
|
21
|
+
labels:
|
|
22
|
+
- 'patch'
|
|
23
|
+
default: patch
|
|
24
|
+
template: |
|
|
25
|
+
## Other Changes
|
|
26
|
+
|
|
27
|
+
$CHANGES
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This is an action to close asana tasks that were generated by Github issues
|
|
2
|
+
|
|
3
|
+
name: Zapier web hook
|
|
4
|
+
|
|
5
|
+
# Controls when the workflow will run
|
|
6
|
+
on:
|
|
7
|
+
# Triggers the workflow on push or pull request events but only for the "main" branch
|
|
8
|
+
issues:
|
|
9
|
+
types: [closed]
|
|
10
|
+
|
|
11
|
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
12
|
+
jobs:
|
|
13
|
+
# This workflow contains a single job called "build"
|
|
14
|
+
build:
|
|
15
|
+
# The type of runner that the job will run on
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
19
|
+
steps:
|
|
20
|
+
# Runs a set of commands using the runners shell
|
|
21
|
+
- name: Call Zapier web hook to close Asana task
|
|
22
|
+
if: ${{ !github.event.issue.pull_request }}
|
|
23
|
+
run: |
|
|
24
|
+
curl --location --request POST 'https://hooks.zapier.com/hooks/catch/12728683/b7009qc/' \
|
|
25
|
+
--header 'Content-Type: application/json' \
|
|
26
|
+
--header 'Accept: application/json' \
|
|
27
|
+
--data-raw '{
|
|
28
|
+
"task_name" : "${{ github.event.issue.title }}"
|
|
29
|
+
}'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
name: Release Drafter
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
# branches to consider in the event; optional, defaults to all
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
# pull_request event is required only for autolabeler
|
|
10
|
+
pull_request:
|
|
11
|
+
# Only following types are handled by the action, but one can default to all as well
|
|
12
|
+
types: [opened, reopened, synchronize]
|
|
13
|
+
# pull_request_target event is required for autolabeler to support PRs from forks
|
|
14
|
+
# pull_request_target:
|
|
15
|
+
# types: [opened, reopened, synchronize]
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
update_release_draft:
|
|
22
|
+
permissions:
|
|
23
|
+
# write permission is required to create a github release
|
|
24
|
+
contents: write
|
|
25
|
+
# write permission is required for autolabeler
|
|
26
|
+
# otherwise, read permission is required at least
|
|
27
|
+
pull-requests: write
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
# (Optional) GitHub Enterprise requires GHE_HOST variable set
|
|
31
|
+
#- name: Set GHE_HOST
|
|
32
|
+
# run: |
|
|
33
|
+
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
|
|
34
|
+
|
|
35
|
+
# Drafts your next Release notes as Pull Requests are merged into "master"
|
|
36
|
+
- uses: release-drafter/release-drafter@v5
|
|
37
|
+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
|
|
38
|
+
# with:
|
|
39
|
+
# config-name: my-config.yml
|
|
40
|
+
# disable-autolabeler: true
|
|
41
|
+
env:
|
|
42
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## March 2023
|
|
5
|
+
### `1.3.1` - 03/03/23
|
|
6
|
+
#### Changes
|
|
7
|
+
- Update monorepo logic to rely on the more reliable `require.resolve` to find the `onesignal-expo-plugin` package.
|
|
8
|
+
|
|
4
9
|
## November 2022
|
|
5
10
|
### `1.3.0` - 11/30/22
|
|
6
11
|
#### Changes
|
package/EAS.md
CHANGED
|
@@ -18,4 +18,4 @@ For development/internal distribution builds, you will need to install a [develo
|
|
|
18
18
|
2. In the terminal, run `expo start --dev-client` to be able to serve the application to the client.
|
|
19
19
|
3. Scan the generated QR code to open the dev client and fetch the app bundle from the running Expo process.
|
|
20
20
|
4. You may be prompted to allow the app to find local area network devices. Approve.
|
|
21
|
-
5. Rescan the QR code & open the app. At this point, you should see the
|
|
21
|
+
5. Rescan the QR code & open the app. At this point, you should see the metro bundler working. As soon as the bundle is complete, your working app should open!
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<h1 align="center">Welcome to onesignal-expo-plugin 👋</h1>
|
|
1
|
+
<h1 align="center">Welcome to the onesignal-expo-plugin 👋</h1>
|
|
2
2
|
<p>
|
|
3
3
|
<a href="https://www.npmjs.com/package/onesignal-expo-plugin" target="_blank">
|
|
4
4
|
<img alt="Version" src="https://img.shields.io/npm/v/onesignal-expo-plugin.svg">
|
|
@@ -30,9 +30,10 @@ This plugin is an [Expo Config Plugin](https://docs.expo.dev/guides/config-plugi
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
32
|
## Install
|
|
33
|
+
You need both the `onesignal-expo-plugin` *and* the `react-native-onesignal` npm package.
|
|
33
34
|
|
|
34
35
|
```sh
|
|
35
|
-
expo install onesignal-expo-plugin
|
|
36
|
+
npx expo install onesignal-expo-plugin
|
|
36
37
|
|
|
37
38
|
# npm
|
|
38
39
|
npm install react-native-onesignal
|
|
@@ -43,7 +44,7 @@ yarn add react-native-onesignal
|
|
|
43
44
|
|
|
44
45
|
## Configuration in app.json / app.config.js
|
|
45
46
|
### Plugin
|
|
46
|
-
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:
|
|
47
|
+
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 `npx expo install`. Just make sure it is the first plugin in the array and to configure any desired plugin props:
|
|
47
48
|
|
|
48
49
|
**app.json**
|
|
49
50
|
```json
|
|
@@ -119,9 +120,9 @@ In your configuration file, make sure you set:
|
|
|
119
120
|
|
|
120
121
|
| Property | Details |
|
|
121
122
|
|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
122
|
-
| `version` | Your app version. Corresponds to `CFBundleShortVersionString` on iOS. This value will be used in your NSE* target's plist file. |
|
|
123
|
-
| `ios.buildNumber` | Build number for your iOS standalone app. Corresponds to `CFBundleVersion` and must match Apple's specified format. This value will be used in your NSE* target's plist file. |
|
|
124
|
-
| `ios.bundleIdentifier` | Bundle identifier for your iOS standalone app. Corresponds to `CFBundleIdentifier`. This value will be used in your NSE* target's plist and entitlements file. |
|
|
123
|
+
| `version` | Your app version. Corresponds to `CFBundleShortVersionString` on iOS. It is a human-readable version number of an iOS app, and is typically in the format of "X.X.X" (e.g. "1.0" or "2.3.1"). It is the version number that is typically displayed to users in the App Store and in the app itself. This value will be used in your NSE* target's plist file. |
|
|
124
|
+
| `ios.buildNumber` | Build number for your iOS standalone app. Corresponds to `CFBundleVersion` and must match Apple's specified format (e.g: "42" or "100"). The build number is used by the App Store and iOS to identify and track different versions of an app, and is typically incremented for each new release. It is a number typically used for the developer's and system reference. This value will be used in your NSE* target's plist file. |
|
|
125
|
+
| `ios.bundleIdentifier` | Bundle identifier for your iOS standalone app. Corresponds to `CFBundleIdentifier`. It's a unique identifier string that is used to identify an iOS app or bundle. It is typically in the format of `"com.companyname.appname"` (e.g. `"com.example.myapp"`). This value will be used in your NSE* target's plist and entitlements file. |
|
|
125
126
|
|
|
126
127
|
\* NSE = Notification Service Extension. Learn more about the NSE [here](https://documentation.onesignal.com/docs/service-extensions).
|
|
127
128
|
|
|
@@ -141,24 +142,24 @@ It may make sense to prebuild locally to inspect config plugin changes and help
|
|
|
141
142
|
|
|
142
143
|
#### Run
|
|
143
144
|
```sh
|
|
144
|
-
expo prebuild
|
|
145
|
+
npx expo prebuild
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
```sh
|
|
148
149
|
# nukes changes and rebuilds
|
|
149
|
-
expo prebuild --clean
|
|
150
|
+
npx expo prebuild --clean
|
|
150
151
|
```
|
|
151
152
|
|
|
152
|
-
**EAS Note:** if you choose to stay in a fully managed workflow by not prebuilding, EAS will still run `expo prebuild` at build time. You can also prebuild locally but remain in a fully managed workflow by adding the `android` and `ios` directories to your .gitignore.
|
|
153
|
+
**EAS Note:** if you choose to stay in a fully managed workflow by not prebuilding, EAS will still run `npx expo prebuild` at build time. You can also prebuild locally but remain in a fully managed workflow by adding the `android` and `ios` directories to your .gitignore.
|
|
153
154
|
|
|
154
155
|
## Run
|
|
155
156
|
The following commands will prebuild *and* run your application. Note that for iOS, push notifications will **not** work in the Simulator.
|
|
156
157
|
```sh
|
|
157
158
|
# Build and run your native iOS project
|
|
158
|
-
expo run:ios
|
|
159
|
+
npx expo run:ios
|
|
159
160
|
|
|
160
161
|
# Build and run your native Android project
|
|
161
|
-
expo run:android
|
|
162
|
+
npx expo run:android
|
|
162
163
|
```
|
|
163
164
|
|
|
164
165
|
---
|
|
@@ -180,5 +181,5 @@ Give a ⭐️ if this project helped you!
|
|
|
180
181
|
|
|
181
182
|
## 📝 License
|
|
182
183
|
|
|
183
|
-
Copyright ©
|
|
184
|
+
Copyright © 2023 [OneSignal](https://github.com/OneSignal).<br />
|
|
184
185
|
This project is [MIT](https://github.com/OneSignal/onesignal-expo-plugin/blob/main/LICENSE) licensed.
|
|
@@ -33,6 +33,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
exports.xcodeProjectAddNse = exports.withOneSignalIos = void 0;
|
|
34
34
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
35
35
|
const fs = __importStar(require("fs"));
|
|
36
|
+
const path = __importStar(require("path"));
|
|
36
37
|
const xcode_1 = __importDefault(require("xcode"));
|
|
37
38
|
const iosConstants_1 = require("../support/iosConstants");
|
|
38
39
|
const updatePodfile_1 = require("../support/updatePodfile");
|
|
@@ -108,13 +109,9 @@ const withOneSignalNSE = (config, onesignalProps) => {
|
|
|
108
109
|
iPhoneDeploymentTarget: onesignalProps === null || onesignalProps === void 0 ? void 0 : onesignalProps.iPhoneDeploymentTarget,
|
|
109
110
|
iosNSEFilePath: onesignalProps.iosNSEFilePath
|
|
110
111
|
};
|
|
111
|
-
// support for monorepos where node_modules can be
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
for (let x = 0; x < 5 && !FileManager_1.FileManager.dirExists(dir); x++) {
|
|
115
|
-
dir = "../" + dir;
|
|
116
|
-
}
|
|
117
|
-
xcodeProjectAddNse(props.modRequest.projectName || "", options, dir + "/onesignal-expo-plugin/build/support/serviceExtensionFiles/");
|
|
112
|
+
// support for monorepos where node_modules can be above the project directory.
|
|
113
|
+
const pluginDir = require.resolve("onesignal-expo-plugin/package.json");
|
|
114
|
+
xcodeProjectAddNse(props.modRequest.projectName || "", options, path.join(pluginDir, "../build/support/serviceExtensionFiles/"));
|
|
118
115
|
return props;
|
|
119
116
|
});
|
|
120
117
|
};
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
withXcodeProject,
|
|
11
11
|
} from "@expo/config-plugins";
|
|
12
12
|
import * as fs from 'fs';
|
|
13
|
+
import * as path from 'path';
|
|
13
14
|
import xcode from 'xcode';
|
|
14
15
|
import {
|
|
15
16
|
DEFAULT_BUNDLE_SHORT_VERSION,
|
|
@@ -106,17 +107,13 @@ const withOneSignalNSE: ConfigPlugin<OneSignalPluginProps> = (config, onesignalP
|
|
|
106
107
|
iosNSEFilePath: onesignalProps.iosNSEFilePath
|
|
107
108
|
};
|
|
108
109
|
|
|
109
|
-
// support for monorepos where node_modules can be
|
|
110
|
-
|
|
111
|
-
let dir = "node_modules"
|
|
112
|
-
for(let x=0; x < 5 && !FileManager.dirExists(dir); x++) {
|
|
113
|
-
dir = "../" + dir
|
|
114
|
-
}
|
|
110
|
+
// support for monorepos where node_modules can be above the project directory.
|
|
111
|
+
const pluginDir = require.resolve("onesignal-expo-plugin/package.json")
|
|
115
112
|
|
|
116
113
|
xcodeProjectAddNse(
|
|
117
114
|
props.modRequest.projectName || "",
|
|
118
115
|
options,
|
|
119
|
-
|
|
116
|
+
path.join(pluginDir, "../build/support/serviceExtensionFiles/")
|
|
120
117
|
);
|
|
121
118
|
|
|
122
119
|
return props;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onesignal-expo-plugin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.",
|
|
5
5
|
"main": "./app.plugin.js",
|
|
6
6
|
"scripts": {
|