Skip to content

Commit

Permalink
Merge pull request #135 from BranchMetrics/fix-auto-verify-error
Browse files Browse the repository at this point in the history
Fix auto verify error
  • Loading branch information
aaustin committed May 9, 2016
2 parents 9845529 + 5a8ed9e commit c9dfc81
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hooks/lib/android/manifestWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Class injects plugin preferences into AndroidManifest.xml file.
*/
function injectOptions(manifestData, pluginPreferences) {
var changedManifest = manifestData,
targetSdk = changedManifest['manifest']['uses-sdk'][0]['$']['android:targetSdkVersion'],
activitiesList = changedManifest['manifest']['application'][0]['activity'],
launchActivityIndex = getMainLaunchActivityIndex(activitiesList),
ulIntentFilters = [],
Expand All @@ -185,7 +186,7 @@ Class injects plugin preferences into AndroidManifest.xml file.

// generate intent-filters
pluginPreferences.hosts.forEach(function(host) {
ulIntentFilters.push(createIntentFilter(host.name, host.scheme, pluginPreferences.androidPrefix));
ulIntentFilters.push(createIntentFilter(host.name, host.scheme, pluginPreferences.androidPrefix, parseInt(targetSdk) >= 23));
});

// add Universal Links intent-filters to the launch activity
Expand Down Expand Up @@ -253,7 +254,7 @@ Class injects plugin preferences into AndroidManifest.xml file.
* @param {String} pathName - host path
* @return {Object} intent-filter as a JSON object
*/
function createIntentFilter(host, scheme, pathPrefix) {
function createIntentFilter(host, scheme, pathPrefix, androidM) {
var intentFilter = {
'$' : {
'android:autoVerify': 'true'
Expand Down Expand Up @@ -281,6 +282,10 @@ Class injects plugin preferences into AndroidManifest.xml file.
}]
};

if (!androidM) {
delete intentFilter['$']['android:autoVerify'];
}

return intentFilter;
}

Expand Down

0 comments on commit c9dfc81

Please sign in to comment.