-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[eas-cli] integrate push key setup in ios builds #473
Conversation
Size Change: +3.44 kB (0%) Total Size: 37.6 MB
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In expo-cli people have more issues with notifications on android, because on ios it's integrated with a build process.
Current implementation unifies those 2 workflows, but the user must know what they are doing. I'm not against adding that as an optional step to the build process, but I believe that it makes sense only if we are doing it for both platforms.
Also, I don't see a solution for that, but currently, if someone does not want to setup their push notification credentials they will get a prompt every time they build (unless they use non-interactive), it might be anoying
@@ -44,6 +51,57 @@ export async function ensureIosCredentialsAsync( | |||
}; | |||
} | |||
|
|||
export async function setupPushKeyAsync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider moving
- this logic to separate Action
- calling this function from Ios credentials provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved some of this logic to a separate Action. There's some parts that are specific to the build command (abort if we are building for simulator, create credentials ctx from build ctx, etc) that I left behind. Let me know if this is consistent with what you meant, or if you'd rather just get rid of the whole method and refactor it elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could move
setupPushKeyAsync
implementation to https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/credentials/ios/IosCredentialsProvider.ts- call
setupPushKeyAsync
in https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/credentials/ios/IosCredentialsProvider.ts#L26 after normal credentials generation
This way:
- you don't need to call
shouldProvideCredentials
because it's already verified here https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/build/ios/credentials.ts#L15 setupPushKeyAsync
would be simpler, because you won't need to create new context
It does not matter that much, so if you prefer to keep the current implementation I'm fine with it.
Looks good to me. I agree with @wkozyra95 that we should also add support for setting up Android push notification keys.
IMO EAS CLI supports |
I disagree with that, I don't think credentials.json should support that
The middle ground that might be more reasonable would be to display the same interactive setup process for the push key even if someone is using credentials.json. I'm not against that approach, but I also don't think there is a need for that. |
Well, generally, I'm not saying that I want to add push credentials to
I like this idea. |
On supporting push key setup for Android: It is easier to set this up for the user in iOS because we can do it programmatically. In Android, it is more troublesome for the user because we only support FCM key uploads and I suspect this is why we don't integrate it into the Android build flow currently. Users need to go into their Firebase console, get the key and paste it into the cli at build time which can be annoying. We may need to change the experience so users can 'give up' if they rather do it later, or look into programmatically setting up fcm for folks. On someone not wanting to setup push notifications: Yeah, it will be annoying to keep prompting users in this case. A similar use case came up when we were wanting to integrate App specific passwords into the Submissions flow with bartek k, where we want to support a 'No, don't ask me again' option. This seems to be a recurring ask, I can look into exposing a stateful question (similar to the way we remember local passwords for user's Apple accounts) if we think it would be useful. On |
@@ -44,6 +51,57 @@ export async function ensureIosCredentialsAsync( | |||
}; | |||
} | |||
|
|||
export async function setupPushKeyAsync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could move
setupPushKeyAsync
implementation to https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/credentials/ios/IosCredentialsProvider.ts- call
setupPushKeyAsync
in https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/credentials/ios/IosCredentialsProvider.ts#L26 after normal credentials generation
This way:
- you don't need to call
shouldProvideCredentials
because it's already verified here https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/build/ios/credentials.ts#L15 setupPushKeyAsync
would be simpler, because you won't need to create new context
It does not matter that much, so if you prefer to keep the current implementation I'm fine with it.
Checklist
[EAS BUILD API]
if it's a part of a breaking change to EAS Build API (only possible when updating@expo/eas-build-job
package).Why
Bring
eas-cli
to parity withexpo-cli
. Inexpo-cli
, we offer to setup push notifications for the user if it hasn't been setup already. We do the same ineas-cli
, except if the user has specified they want to use credentials fromcredentials.json
. Users who opt to usecredentials.json
do so because they don't want to store their credentials indefinitely onwww
. However, setting up a push key requires you to actually store your push key indefinitely on www. So if a user opts to usecredentials.json
, we skip push key setup altogether.prereqs
Test Plan