-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from jquick-axway/TIMOB-27746
fix: firebase upload issue with AndroidManifest.xml
- Loading branch information
Showing
15 changed files
with
3,285 additions
and
584 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
node_modules | ||
|
||
android/bin/ | ||
android/build/ | ||
android/dist/ | ||
ios/build/ | ||
ios/dist/ | ||
|
||
# These should eventually be linted as well | ||
android/example/ | ||
ios/example/ |
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,16 @@ | ||
{ | ||
"extends": [ "axway/env-titanium", "axway/env-node" ], | ||
"parserOptions": { | ||
"ecmaVersion": 2015, | ||
"sourceType": "script" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "dangerfile.js" ], | ||
"parserOptions": { | ||
"ecmaVersion": 2017, | ||
"sourceType": "module" | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
Language: Java | ||
AccessModifierOffset: -4 | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
# class, constructor, method should be next line | ||
BreakBeforeBraces: Linux | ||
# Keep '=' at end of line when wrapping, but move things like '&&', '||' to beginning of newline | ||
BreakBeforeBinaryOperators: NonAssignment | ||
# FIXME: break for brace after synchronized block, anonymous class declarations | ||
BreakAfterJavaFieldAnnotations: true | ||
ColumnLimit: 120 | ||
IndentCaseLabels: true | ||
IndentWidth: 4 | ||
MaxEmptyLinesToKeep: 1 | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: ControlStatements | ||
SpacesInParentheses: false | ||
TabWidth: 4 | ||
UseTab: ForContinuationAndIndentation | ||
SpaceAfterCStyleCast: true | ||
# Spaces inside {} for array literals, i.e. "new Object[] { args }" | ||
Cpp11BracedListStyle: false | ||
ReflowComments: false |
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,90 +1,90 @@ | ||
const MAX_RETRY = 1; | ||
|
||
function makeGooglePlayServicesAvailable (callback, _retry = 0) { | ||
let result = { | ||
success: false, | ||
code: undefined, | ||
message: undefined | ||
}; | ||
let result = { | ||
success: false, | ||
code: undefined, | ||
message: undefined | ||
}; | ||
|
||
// Attempt to load ti.playservices module if available. | ||
try { | ||
const PlayServices = require('ti.playservices'); | ||
const playServicesResult = PlayServices.isGooglePlayServicesAvailable(); | ||
const playServicesVersion = PlayServices.GOOGLE_PLAY_SERVICES_VERSION_CODE; | ||
// Attempt to load ti.playservices module if available. | ||
try { | ||
const PlayServices = require('ti.playservices'); | ||
const playServicesResult = PlayServices.isGooglePlayServicesAvailable(); | ||
const playServicesVersion = PlayServices.GOOGLE_PLAY_SERVICES_VERSION_CODE; | ||
|
||
// Listener callback to determine when the user has returned to the app | ||
function playServicesResume () { | ||
Ti.App.removeEventListener('resume', playServicesResume); | ||
makeGooglePlayServicesAvailable(callback, ++_retry); | ||
}; | ||
// Listener callback to determine when the user has returned to the app | ||
function playServicesResume () { | ||
Ti.App.removeEventListener('resume', playServicesResume); | ||
makeGooglePlayServicesAvailable(callback, ++_retry); | ||
} | ||
|
||
// Google Play Services is available. | ||
result.code = playServicesResult; | ||
if (playServicesResult === PlayServices.RESULT_SUCCESS) { | ||
result.success = true; | ||
result.message = `Google Play Services is available. (version: ${playServicesVersion})`; | ||
} else { | ||
result.success = false; | ||
result.message = `Google Play Services is unavailable. (${PlayServices.getErrorString(playServicesResult)})`; | ||
// Google Play Services is available. | ||
result.code = playServicesResult; | ||
if (playServicesResult === PlayServices.RESULT_SUCCESS) { | ||
result.success = true; | ||
result.message = `Google Play Services is available. (version: ${playServicesVersion})`; | ||
} else { | ||
result.success = false; | ||
result.message = `Google Play Services is unavailable. (${PlayServices.getErrorString(playServicesResult)})`; | ||
|
||
switch (playServicesResult) { | ||
switch (playServicesResult) { | ||
|
||
// Google Play Services is missing or outdated. | ||
// Attempt to open Google Play store so user can install latest. | ||
case PlayServices.RESULT_SERVICE_MISSING: | ||
case PlayServices.RESULT_SERVICE_VERSION_UPDATE_REQUIRED: | ||
case PlayServices.RESULT_SERVICE_UPDATING: | ||
if (_retry < MAX_RETRY) { | ||
const installPlayServicesIntent = Ti.Android.createIntent({ | ||
action: Ti.Android.ACTION_VIEW, | ||
data: 'market://details?id=com.google.android.gms' | ||
}); | ||
Ti.Android.currentActivity.startActivity(installPlayServicesIntent); | ||
|
||
setTimeout(() => { | ||
Ti.App.addEventListener('resume', playServicesResume); | ||
}, 1000); | ||
return; | ||
} | ||
break; | ||
|
||
// Google Play Services has been disabled. | ||
// Attempt to open Google Play Services app info so user can re-enable. | ||
case PlayServices.RESULT_SERVICE_DISABLED: | ||
if (_retry < MAX_RETRY) { | ||
const detailPlayServicesIntent = Ti.Android.createIntent({ | ||
action: 'android.settings.APPLICATION_DETAILS_SETTINGS', | ||
flags: Ti.Android.FLAG_ACTIVITY_NEW_TASK, | ||
data: 'package:com.google.android.gms' | ||
}); | ||
Ti.Android.currentActivity.startActivity(detailPlayServicesIntent); | ||
// Google Play Services is missing or outdated. | ||
// Attempt to open Google Play store so user can install latest. | ||
case PlayServices.RESULT_SERVICE_MISSING: | ||
case PlayServices.RESULT_SERVICE_VERSION_UPDATE_REQUIRED: | ||
case PlayServices.RESULT_SERVICE_UPDATING: | ||
if (_retry < MAX_RETRY) { | ||
const installPlayServicesIntent = Ti.Android.createIntent({ | ||
action: Ti.Android.ACTION_VIEW, | ||
data: 'market://details?id=com.google.android.gms' | ||
}); | ||
Ti.Android.currentActivity.startActivity(installPlayServicesIntent); | ||
|
||
setTimeout(() => { | ||
Ti.App.addEventListener('resume', playServicesResume); | ||
}, 1000); | ||
return; | ||
} | ||
break; | ||
setTimeout(() => { | ||
Ti.App.addEventListener('resume', playServicesResume); | ||
}, 1000); | ||
return; | ||
} | ||
break; | ||
|
||
// Google Play Services is invalid. | ||
// This could be running on an unsupported device. | ||
case PlayServices.RESULT_SERVICE_INVALID: | ||
result.message += `\nThis could be an unsupported device.`; | ||
break; | ||
} | ||
} | ||
// Google Play Services has been disabled. | ||
// Attempt to open Google Play Services app info so user can re-enable. | ||
case PlayServices.RESULT_SERVICE_DISABLED: | ||
if (_retry < MAX_RETRY) { | ||
const detailPlayServicesIntent = Ti.Android.createIntent({ | ||
action: 'android.settings.APPLICATION_DETAILS_SETTINGS', | ||
flags: Ti.Android.FLAG_ACTIVITY_NEW_TASK, | ||
data: 'package:com.google.android.gms' | ||
}); | ||
Ti.Android.currentActivity.startActivity(detailPlayServicesIntent); | ||
|
||
// Google Play Services is not available... | ||
} catch (e) { | ||
result.success = false; | ||
result.message = `Could not load 'ti.playservices' module.`; | ||
} | ||
setTimeout(() => { | ||
Ti.App.addEventListener('resume', playServicesResume); | ||
}, 1000); | ||
return; | ||
} | ||
break; | ||
|
||
Ti.API.info(`ti.playservices: ${result.message}`); | ||
callback(result); | ||
// Google Play Services is invalid. | ||
// This could be running on an unsupported device. | ||
case PlayServices.RESULT_SERVICE_INVALID: | ||
result.message += '\nThis could be an unsupported device.'; | ||
break; | ||
} | ||
} | ||
|
||
// Google Play Services is not available... | ||
} catch (e) { | ||
result.success = false; | ||
result.message = 'Could not load \'ti.playservices\' module.'; | ||
} | ||
|
||
Ti.API.info(`ti.playservices: ${result.message}`); | ||
callback(result); | ||
} | ||
|
||
module.exports = { | ||
makeGooglePlayServicesAvailable | ||
makeGooglePlayServicesAvailable | ||
}; |
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
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
Oops, something went wrong.