Open captaincole opened 7 years ago
I have found the real issue here. This plugin does not update based on variables set in the config.xml file, only upon what was originally set in the installation call.
What I would expect is that when I save a new config.xml and rebuild my environment, the new configuration should show up in the new AndroidManifest.xml.
After looking through your code, I have found what is happening. I guess this should be relabled as an "Enhancement" although it seems like something that should be supported out of the box.
in hooks/lib/afterPrepareHook.js
you are succesfully retrieving the deepLinkHost variable from config.xml, but then do not write it out to the AndroidManifest.xml file. It seems that you do this for iOS though.
function activateUniversalLinksInIos(cordovaContext, deeplinkHost) {
// modify xcode project preferences
iosProjectPreferences.enableAssociativeDomainsCapability(cordovaContext);
// generate entitlements file
iosProjectEntitlements.generateAssociatedDomainsEntitlements(cordovaContext, deeplinkHost);
}
Would definitely make a pull request with fix, but I am not sure what the proper way to write out to the android.json file is.
im also facing this issue, can anyone help me @thielCole
@Prabhat36 The workaround is to uninstall and reinstall the plugin with the correct variables.
@thielCole - for interests sake, why did you specify these settings, or where did you see that the plugin depended on them?
<plugin name="ionic-plugin-deeplinks" spec="~1.0.14">
<variable name="URL_SCHEME" value="plank38"/>
<variable name="DEEPLINK_SCHEME" value="https"/>
<variable name="DEEPLINK_HOST" value="api.38plank.com"/>
<variable name="ANDROID_PATH_PREFIX" value="/" />
</plugin>
I am asking because it was not specified in the docs anywhere, so just wanted to confirm if this is necessary?
@Prabhat36 - I guess you are having the same issue as I logged here https://github.com/driftyco/ionic-plugin-deeplinks/issues/81.
https://github.com/nordnet/cordova-universal-links-plugin @jacquesdev use this plugin it works like charm and well explained plugin
Thanks @Prabhat36 - that is an excellent suggestion!
Yes, I used this plugin because it was hosted by ionic. @jacquesdev to answer your question, I did it by adding a --save at the end of my plugin install command
cordova plugin add ionic-plugin-deeplinks@1.0.14 --variable URL_SCHEME='MyScheme' --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=MyURL.com --save
@Prabhat36 I only used this because it was hosted by ionic and I am developing on top of that framework, but the other plugin looks very good also.
When I configured my plugin I have this specified.
And the value that shows up in the AndroidManifest.xml is
where I would expect my android:host to equal "api.38plank.com"