forked from tschoffelen/react-native-email-link
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a config plugin for automatic setup with Expo
- Loading branch information
1 parent
87c3b9c
commit 7d7a3a4
Showing
5 changed files
with
67 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="agency.flexible.react.modules.email"> | ||
<!-- Required for react-native-email-link on Android 30+ --> | ||
<queries> | ||
<intent> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<data android:scheme="mailto"/> | ||
</intent> | ||
</queries> | ||
</manifest> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("./plugin/withEmailLink"); |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Adds the given query schemes to the infoPlist app config | ||
*/ | ||
const withLSApplicationQueriesSchemes = ( | ||
config, | ||
schemes | ||
) => { | ||
if (!config.ios) { | ||
config.ios = {}; | ||
} | ||
if (!config.ios.infoPlist) { | ||
config.ios.infoPlist = {}; | ||
} | ||
if (!Array.isArray(config.ios.infoPlist.LSApplicationQueriesSchemes)) { | ||
config.ios.infoPlist.LSApplicationQueriesSchemes = []; | ||
} | ||
|
||
config.ios.infoPlist.LSApplicationQueriesSchemes = [ | ||
...new Set([ | ||
...config.ios.infoPlist.LSApplicationQueriesSchemes, | ||
...schemes, | ||
]), | ||
]; | ||
|
||
return config; | ||
}; | ||
|
||
/** | ||
* Configures Expo | ||
*/ | ||
const withEmailLink = (config) => { | ||
config = withLSApplicationQueriesSchemes(config, [ | ||
"message", | ||
"readdle-spark", | ||
"airmail", | ||
"ms-outlook", | ||
"googlegmail", | ||
"inbox-gmail", | ||
"ymail", | ||
"superhuman", | ||
"yandexmail", | ||
"fastmail", | ||
"protonmail", | ||
]); | ||
return config; | ||
}; | ||
|
||
exports.default = withEmailLink; |