Implement IDynamicLinksService.getDynamicLink() for compatibility with react native firebase email link auth #2297
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.
Currently the implementation of getInitialLink just returns null to the client which breaks the authentication method of react native firebase using an email link only.
In their documentation there is no example code for this, but some apps implement authentication like this:
https://stackoverflow.com/questions/61564203/how-to-setup-sendsigninlinktoemail-from-firebase-in-react-native relying on the payload data of the dynamic links service.
This pull request implements
GmsCore/play-services-core/src/main/java/org/microg/gms/firebase/dynamiclinks/DynamicLinksServiceImpl.java
Lines 41 to 43 in 9e2337a
by parsing the link and returning the correct payload to the client. There are a few security related checks if the package name of the link does not match the receiving package name or if it is missing. I was able to get some logins to work. It might also fix #1547 as this is related to the dynamic links service, but I haven't tested apps reported there.
best :-)