Skip to content

Commit 2aa15fc

Browse files
authored
[MOO-1361] Add check and request EXACT_ALARM_PERMISSION to RequestGenericPermission (#137)
2 parents ba95d30 + a07c481 commit 2aa15fc

File tree

8 files changed

+210
-65
lines changed

8 files changed

+210
-65
lines changed

.github/actions/create-native-bundle/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ runs:
4141
env:
4242
NODE_OPTIONS: --max_old_space_size=6144
4343
- name: "Upload bundle for ${{ inputs.platform }}"
44-
uses: actions/upload-artifact@v3.1.2
44+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
4545
with:
4646
name: ${{ inputs.platform }}-bundle
4747
path: ${{ inputs.platform }}

.github/workflows/NativePipeline.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
runs-on: ubuntu-22.04
3333
steps:
3434
- name: "Check out code"
35-
uses: actions/checkout@v3.4.0
35+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
3636
- name: "Get Mendix version"
3737
id: get-mendix-version
38-
uses: notiz-dev/[email protected]
38+
uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3 # v0.2.0
3939
with:
4040
path: configs/e2e/mendix-versions.json
4141
prop_path: latest
@@ -48,7 +48,7 @@ jobs:
4848
MENDIX_VERSION: ${{ needs.mendix-version.outputs.mendix-version }}
4949
steps:
5050
- name: "Login to GitHub Container Registry"
51-
uses: docker/login-action@v2.1.0
51+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
5252
with:
5353
registry: ghcr.io
5454
username: ${{ github.actor }}
@@ -58,11 +58,11 @@ jobs:
5858
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }} || EXIT_CODE=$?
5959
echo "IMAGE_MISSING=$EXIT_CODE" >> $GITHUB_ENV
6060
- name: "Check out code"
61-
uses: actions/checkout@v3.4.0
61+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
6262
if: ${{ env.IMAGE_MISSING != 0 }}
6363
- name: "Build mxbuild image"
6464
if: ${{ env.IMAGE_MISSING != 0 }}
65-
uses: docker/build-push-action@v4.0.0
65+
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
6666
with:
6767
file: ./.github/scripts/mxbuild.Dockerfile
6868
context: ./.github/scripts
@@ -79,11 +79,11 @@ jobs:
7979
contents: read
8080
steps:
8181
- name: "Check out code"
82-
uses: actions/checkout@v3.4.0
82+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
8383
with:
8484
fetch-depth: 0
8585
- name: "Set up node"
86-
uses: actions/setup-node@v3.6.0
86+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
8787
with:
8888
node-version-file: .nvmrc
8989
cache: yarn
@@ -96,7 +96,7 @@ jobs:
9696
env:
9797
NODE_OPTIONS: --max_old_space_size=6144
9898
- name: "Upload resources artifact"
99-
uses: actions/upload-artifact@v3.1.2
99+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
100100
with:
101101
name: resources
102102
path: |
@@ -115,11 +115,11 @@ jobs:
115115
- name: "Download test project"
116116
run: curl -L -o project.zip https://github.com/mendix/Native-Mobile-Resources/archive/refs/heads/main.zip
117117
- name: "Extract test project"
118-
uses: montudor/[email protected]
118+
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
119119
with:
120120
args: unzip -qq project.zip
121121
- name: "Download resources artifact"
122-
uses: actions/download-artifact@v3.0.2
122+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
123123
with:
124124
name: resources
125125
path: resources
@@ -146,9 +146,9 @@ jobs:
146146
mv -f resources/jsActions/nanoflow-actions-native/* Native-Mobile-Resources-main/javascriptsource/nanoflowcommons/actions/
147147
fi
148148
- name: "Build test project"
149-
run: mxbuild -o automation.mda Native-Mobile-Resources-main/NativeComponentsTestProject.mpr
149+
run: mxbuild -o automation.mda --loose-version-check Native-Mobile-Resources-main/NativeComponentsTestProject.mpr
150150
- name: "Upload MDA"
151-
uses: actions/upload-artifact@v3.1.2
151+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
152152
with:
153153
name: mda
154154
path: automation.mda
@@ -158,9 +158,9 @@ jobs:
158158
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
159159
steps:
160160
- name: "Check out code"
161-
uses: actions/checkout@v3.4.0
161+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
162162
- name: "Download deployment package"
163-
uses: actions/download-artifact@v3.0.2
163+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
164164
with:
165165
name: mda
166166
- name: "Create Android bundle"
@@ -174,9 +174,9 @@ jobs:
174174
container: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix-version }}
175175
steps:
176176
- name: "Check out code"
177-
uses: actions/checkout@v3.4.0
177+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
178178
- name: "Download project MDA file"
179-
uses: actions/download-artifact@v3.0.2
179+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
180180
with:
181181
name: mda
182182
- name: "Create iOS bundle"
@@ -189,22 +189,22 @@ jobs:
189189
runs-on: ubuntu-22.04
190190
steps:
191191
- name: "Check out Native Template for Native Components Test Project"
192-
uses: actions/checkout@v3.4.0
192+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
193193
with:
194194
repository: mendix/native-template
195195
ref: master
196196
path: native-template
197197
- name: "Check out code"
198-
uses: actions/checkout@v3.4.0
198+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
199199
with:
200200
path: native-widgets
201201
- name: "Download Android bundle and assets"
202-
uses: actions/download-artifact@v3.0.2
202+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
203203
with:
204204
name: android-bundle
205205
path: bundles/android
206206
- name: "Set up Node"
207-
uses: actions/setup-node@v3.6.0
207+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
208208
with:
209209
node-version-file: native-template/.nvmrc
210210
cache: npm
@@ -219,17 +219,17 @@ jobs:
219219
- name: "Install dependencies"
220220
working-directory: native-template
221221
run: npm i
222-
- name: "Setup JDK 11"
223-
uses: actions/setup-java@v3.10.0
222+
- name: "Setup JDK 17"
223+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
224224
with:
225-
java-version: 11
225+
java-version: 17
226226
distribution: temurin
227227
cache: gradle
228228
- name: "Build Android app"
229229
working-directory: native-template/android
230230
run: ./gradlew assembleAppstoreDebug assembleAppstoreDebugAndroidTest
231231
- name: "Archive Android app"
232-
uses: actions/upload-artifact@v3.1.2
232+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
233233
with:
234234
name: android-app
235235
path: native-template/android/app/build/outputs/apk/**/*.apk
@@ -238,22 +238,22 @@ jobs:
238238
runs-on: macos-12
239239
steps:
240240
- name: "Check out Native Template for Native Components Test Project"
241-
uses: actions/checkout@v3.4.0
241+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
242242
with:
243243
repository: mendix/native-template
244244
ref: master
245245
path: native-template
246246
- name: "Check out code"
247-
uses: actions/checkout@v3.4.0
247+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
248248
with:
249249
path: native-widgets
250250
- name: "Download iOS bundle and assets"
251-
uses: actions/download-artifact@v3.0.2
251+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
252252
with:
253253
name: ios-bundle
254254
path: bundles/ios
255255
- name: "Set up Node"
256-
uses: actions/setup-node@v3.6.0
256+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
257257
with:
258258
node-version-file: native-template/.nvmrc
259259
cache: npm
@@ -269,7 +269,7 @@ jobs:
269269
run: npm i
270270

271271
- name: "Setup Pods cache"
272-
uses: actions/cache@v3.3.1
272+
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
273273
with:
274274
path: native-template/Pods
275275
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
@@ -282,17 +282,17 @@ jobs:
282282
working-directory: native-template/ios
283283
run: xcodebuild -workspace NativeTemplate.xcworkspace -scheme nativeTemplate -configuration Debug -sdk iphonesimulator -derivedDataPath build ONLY_ACTIVE_ARCH=YES VALID_ARCHS="i386 x86_64"
284284
- name: "Archive iOS app"
285-
uses: actions/upload-artifact@v3.1.2
285+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
286286
with:
287287
name: ios-app
288288
path: native-template/ios/build/Build/Products/**/*.app
289289
android-avd:
290290
runs-on: macos-12
291291
steps:
292292
- name: "Check out code"
293-
uses: actions/checkout@v3.4.0
293+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
294294
- name: "Setup AVD cache"
295-
uses: actions/cache@v3.3.1
295+
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
296296
id: avd-cache
297297
with:
298298
path: |
@@ -302,7 +302,7 @@ jobs:
302302
key: pixel_30_x86_64_default_3core_and_system_images
303303
- name: "Create AVD and generate snapshot for caching"
304304
if: steps.avd-cache.outputs.cache-hit != 'true'
305-
uses: reactivecircus/android-emulator-runner@v2.27.0
305+
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
306306
with:
307307
api-level: 30
308308
target: default
@@ -321,18 +321,18 @@ jobs:
321321
runs-on: macos-12
322322
steps:
323323
- name: "Check out code"
324-
uses: actions/checkout@v3.4.0
324+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
325325
with:
326326
fetch-depth: 0
327327
- name: "Set up node"
328-
uses: actions/setup-node@v3.6.0
328+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
329329
with:
330330
node-version-file: .nvmrc
331331
cache: yarn
332332
- name: "Install dependencies"
333333
run: yarn install --immutable
334334
- name: "Download project MDA file"
335-
uses: actions/download-artifact@v3.0.2
335+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
336336
with:
337337
name: mda
338338
- name: "Start runtime"
@@ -341,7 +341,7 @@ jobs:
341341
mda-file: automation.mda
342342
mendix-version: ${{ needs.mendix-version.outputs.mendix-version }}
343343
- name: "Download Android app"
344-
uses: actions/download-artifact@v3.0.2
344+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
345345
with:
346346
name: android-app
347347
path: android-app
@@ -350,7 +350,7 @@ jobs:
350350
mkdir -p detox/apps
351351
find android-app -type f -iname "*.apk" -exec mv {} detox/apps/ \;
352352
- name: "Setup AVD cache"
353-
uses: actions/cache@v3.3.1
353+
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
354354
id: avd-cache
355355
with:
356356
path: |
@@ -359,7 +359,7 @@ jobs:
359359
/Users/runner/Library/Android/sdk/system-images/**/*
360360
key: pixel_30_x86_64_default_3core_and_system_images
361361
- name: "Run tests"
362-
uses: reactivecircus/android-emulator-runner@v2.27.0
362+
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1
363363
with:
364364
api-level: 30
365365
target: default
@@ -381,14 +381,14 @@ jobs:
381381
adb shell pm install -r -g -t /data/local/tmp/detox/Test.apk 2>/dev/null
382382
yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test:e2e:android
383383
- name: "Archive runtime logs"
384-
uses: actions/upload-artifact@v3.1.2
384+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
385385
if: always()
386386
with:
387387
name: android-runtime-logs
388388
path: log/*.log
389389
if-no-files-found: ignore
390390
- name: "Archive test screenshot diff results"
391-
uses: actions/upload-artifact@v3.1.2
391+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
392392
if: failure()
393393
with:
394394
name: android-screenshot-results
@@ -397,7 +397,7 @@ jobs:
397397
${{ github.workspace }}/packages/**/e2e/images/actual/**/*.png
398398
if-no-files-found: ignore
399399
- name: "Archive artifacts"
400-
uses: actions/upload-artifact@v3.1.2
400+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
401401
if: always()
402402
with:
403403
name: android-artifacts
@@ -408,18 +408,18 @@ jobs:
408408
runs-on: macos-12
409409
steps:
410410
- name: "Check out code"
411-
uses: actions/checkout@v3.4.0
411+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
412412
with:
413413
fetch-depth: 0
414414
- name: "Set up node"
415-
uses: actions/setup-node@v3.6.0
415+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
416416
with:
417417
node-version-file: .nvmrc
418418
cache: yarn
419419
- name: "Install dependencies"
420420
run: yarn install --immutable
421421
- name: "Download project MDA file"
422-
uses: actions/download-artifact@v3.0.2
422+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
423423
with:
424424
name: mda
425425
# Used when new xCode version of simulator should be created
@@ -435,7 +435,7 @@ jobs:
435435
mda-file: automation.mda
436436
mendix-version: ${{ needs.mendix-version.outputs.mendix-version }}
437437
- name: "Download iOS app"
438-
uses: actions/download-artifact@v3.0.2
438+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
439439
with:
440440
name: ios-app
441441
path: ios-app
@@ -458,14 +458,14 @@ jobs:
458458
- name: "Run tests"
459459
run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test:e2e:ios
460460
- name: "Archive runtime logs"
461-
uses: actions/upload-artifact@v3.1.2
461+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
462462
if: always()
463463
with:
464464
name: ios-runtime-logs
465465
path: log/*.log
466466
if-no-files-found: ignore
467467
- name: "Archive test screenshot diff results"
468-
uses: actions/upload-artifact@v3.1.2
468+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
469469
if: failure()
470470
with:
471471
name: ios-screenshot-results
@@ -474,7 +474,7 @@ jobs:
474474
${{ github.workspace }}/packages/**/e2e/images/actual/**/*.png
475475
if-no-files-found: ignore
476476
- name: "Archive artifacts"
477-
uses: actions/upload-artifact@v3.1.2
477+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
478478
if: always()
479479
with:
480480
name: ios-artifacts

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
### Changed
1010

11+
- Added CheckGenericPermission and updated RequestGenericPermission to support SCHEDULE_EXACT_ALARM_ANDROID permission for Android (relevant for Android 14).
12+
13+
### Changed
14+
1115
- fixed an Android issue in Download file action.
1216

1317
## [6.0.0] Native Mobile Resources - 2024-01-24

packages/jsActions/mobile-resources-native/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"react-native-localize": "1.4.2",
4040
"react-native-permissions": "3.3.1",
4141
"react-native-push-notification": "8.1.1",
42+
"react-native-schedule-exact-alarm-permission": "^0.1.3",
4243
"react-native-sound": "0.11.0",
4344
"react-native-touch-id": "4.4.1",
4445
"url-parse": "^1.4.7"

0 commit comments

Comments
 (0)