feat: add support for custom headers in addPassFromUrl#41
Open
mgcrea wants to merge 6 commits intodev-family:mainfrom
Open
feat: add support for custom headers in addPassFromUrl#41mgcrea wants to merge 6 commits intodev-family:mainfrom
mgcrea wants to merge 6 commits intodev-family:mainfrom
Conversation
Updates addPassFromUrl to accept optional headers parameter for authenticated requests. Changes iOS implementation from direct Data(contentsOf:) to URLSession with proper header and error handling.
Set completion handler before calling showViewController so that when containsPass() returns true, the completion callback is properly invoked instead of being nil.
- Change completion handler to return error code and message - Use Promise rejection instead of resolve(false) for failures - Add specific error codes: INVALID_URL, NETWORK_ERROR, HTTP_ERROR, INVALID_DATA, INVALID_PASS, PASS_ALREADY_EXISTS, NO_VIEW_CONTROLLER, CONTROLLER_ERROR, USER_CANCELLED - Export WalletErrorCode and WalletError types for TypeScript consumers
- Accept all 2xx HTTP status codes, not just 200 - Replace deprecated keyWindow with UIWindowScene API - Remove redundant message property from WalletError type
- Fetch JWT from URL with optional custom headers support - Pass fetched JWT to Google Wallet savePassesJwt API - Add consistent error codes: INVALID_URL, NETWORK_ERROR, HTTP_ERROR, NO_ACTIVITY, API_ERROR, GENERAL_ERROR - Remove Linking.openURL fallback, use native implementation - Update WalletErrorCode type with Android-specific codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi thanks for the lib, I had trouble with authenticated URLs for the passes so I started to tweak the iOS code to support headers. Ended up reworking the API to get proper result codes and also implemented the addPassFromUrl on native Android to be ISO.
That's a lot of changes (breaking) and would need a new major. Feel free to merge or not, I'll maintain a fork meanwhile.
Thanks!