Skip to content

Commit

Permalink
[expo-application] Add methods for app release type and APNs environm…
Browse files Browse the repository at this point in the history
…ent (#6724)

# Why

APNs environment will be useful for `expo-notifications` module. App release type could be useful for users' analytics. 

# How

In the gist of things, I moved `EXProvisioningProfile` from `ExpoKit` to `EXApplication`. Kernel either uses `EXApplication/EXProvisioningProfile` (if it's present) or uses sensible fallback values.

# Test Plan

Added tests to `test-suite`, verified in `bare-expo` that they pass.
  • Loading branch information
sjchmiela committed Jan 21, 2020
1 parent 6c7725f commit 72d142a
Show file tree
Hide file tree
Showing 26 changed files with 403 additions and 254 deletions.
2 changes: 1 addition & 1 deletion apps/bare-expo/ios/Podfile.lock
Expand Up @@ -818,6 +818,6 @@ SPEC CHECKSUMS:
Yoga: ba3d99dbee6c15ea6bbe3783d1f0cb1ffb79af0f
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: f8c0544004c7ca9ffcae29a1b9efb91846964d98
PODFILE CHECKSUM: f9b310a7da0a72b720dd3e0eaf31394e24c3f736

COCOAPODS: 1.8.4

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

152 changes: 80 additions & 72 deletions apps/bare-expo/ios/Pods/EXApplication.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/bare-expo/ios/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions apps/test-suite/tests/Application.js
Expand Up @@ -52,6 +52,18 @@ export async function test({ describe, it, expect, jasmine }) {
expect(error).toBeNull();
});

it('Application.getIosApplicationReleaseTypeAsync() returns a number', async () => {
const appReleaseType = await Application.getIosApplicationReleaseTypeAsync();
expect(appReleaseType).toBeDefined();
expect(appReleaseType).toEqual(jasmine.any(Number));
});

it('Application.getIosPushNotificationServiceEnvironmentAsync() returns a string', async () => {
const apnsEnvironment = await Application.getIosPushNotificationServiceEnvironmentAsync();
expect(apnsEnvironment).toBeDefined();
expect(apnsEnvironment).toEqual(jasmine.any(String));
});

describe(`doesn't get Android-only constants`, () => {
it('Application.androidId is null', () => {
expect(Application.androidId).toBeNull();
Expand Down

0 comments on commit 72d142a

Please sign in to comment.