Skip to content

Commit

Permalink
fix: override singleTop to singleTask on android
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Sep 6, 2017
1 parent d50d48b commit 7ae78dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/scripts/android/updateAndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
manifest = updateMultidex(manifest)
manifest = updateBranchMetaData(manifest, preferences)
manifest = updateBranchReferrerTracking(manifest)
manifest = updateLaunchOptionToSingleTask(manifest, mainActivityIndex, preferences)
manifest = updateLaunchOptionToSingleTask(manifest, mainActivityIndex)
manifest = updateBranchURIScheme(manifest, mainActivityIndex, preferences)
manifest = updateBranchAppLinks(manifest, mainActivityIndex, preferences)

Expand Down Expand Up @@ -98,7 +98,7 @@

// adds to main <activity>:
// android:launchMode="singleTask"
function updateLaunchOptionToSingleTask (manifest, mainActivityIndex, preferences) {
function updateLaunchOptionToSingleTask (manifest, mainActivityIndex) {
manifest['manifest']['application'][0]['activity'][mainActivityIndex]['$']['android:launchMode'] = 'singleTask'
return manifest
}
Expand Down
5 changes: 5 additions & 0 deletions src/scripts/hooks/afterPrepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
'use strict'
var configPreferences = require('../npm/processConfigXml.js')
var iosDevelopmentTeam = require('../ios/updateDevelopmentTeam.js')
var androidManifest = require('../android/updateAndroidManifest.js')
var ANDROID = 'android'
var IOS = 'ios'

// entry
Expand All @@ -14,6 +16,9 @@
var platforms = context.opts.cordova.platforms

platforms.forEach(function (platform) {
if (platform === ANDROID) {
androidManifest.writePreferences(context, preferences)
}
if (platform === IOS) {
iosDevelopmentTeam.addDevelopmentTeam(preferences)
}
Expand Down
5 changes: 0 additions & 5 deletions src/scripts/hooks/beforePrepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
var iosPlist = require('../ios/updatePlist.js')
var iosCapabilities = require('../ios/enableEntitlements.js')
var iosAssociatedDomains = require('../ios/updateAssociatedDomains.js')
var androidManifest = require('../android/updateAndroidManifest.js')
var IOS = 'ios'
var ANDROID = 'android'

// entry
module.exports = run
Expand All @@ -18,9 +16,6 @@
var platforms = context.opts.cordova.platforms

platforms.forEach(function (platform) {
if (platform === ANDROID) {
androidManifest.writePreferences(context, preferences)
}
if (platform === IOS) {
iosPlist.addBranchSettings(preferences)
iosCapabilities.enableAssociatedDomains(preferences)
Expand Down

0 comments on commit 7ae78dd

Please sign in to comment.