Created
October 23, 2019 04:31
-
-
Save exclusiveTanim/4de133fdb010760974de470ff61a9819 to your computer and use it in GitHub Desktop.
Test Code
This file contains hidden or 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
// Customer have this code in his app | |
if (OS_IOS) { | |
Ti.App.addEventListener("resumed", function() { | |
console.log("I AM FIRED ON RESUME"); | |
processArgs(); | |
}); | |
} | |
// this is the processArgs method | |
function processArgs() { | |
console.log("I AM FIRED ON processArgs"); | |
Alloy.Globals.aca.leaveBreadcrumb('Process Arguments for IOS: '); | |
if (Ti.App.getArguments().url) { | |
console.log("I AM FIRED ON processArgs url " + Ti.App.getArguments().url); | |
var response = urlToObject(Ti.App.getArguments().url); | |
isTranmsitSuccesfullIOS = response["success"]; | |
Alloy.Globals.aca.leaveBreadcrumb('IOS transmitt success ' + isTranmsitSuccesfullIOS); | |
var badge_flash_status; | |
if (isTranmsitSuccesfullIOS) { | |
badge_flash_status_ios = true; | |
} else { | |
badge_flash_status_ios = ''; | |
} | |
if (isTranmsitSuccesfullIOS) { | |
$.btn_checkout.setEnabled(true); | |
$.btn_checkout.setBackgroundColor(Alloy.Globals.colors.reptraxBlue); | |
$.btn_checkout.addEventListener('click', handleCheckinCheckout); | |
} else if (!isTranmsitSuccesfullIOS) { | |
var dialog = Ti.UI.createAlertDialog({ | |
buttonNames: ['OK'], | |
message: "There was an error while transmitting.Please try transmit again.", | |
title: " Error" | |
}); | |
} | |
api.get({ | |
url: 'badge_flashed_status', | |
data: { | |
token: rep_token, | |
visit_id: Alloy.Globals.visitId, | |
badge_flash_status: badge_flash_status_ios | |
}, | |
success: function(_response) { | |
Alloy.Globals.aca.leaveBreadcrumb('Badge Flash Status to Reptrax: ' + _response); | |
console.log(_response); | |
}, | |
error: function(_response) { | |
Alloy.Globals.aca.leaveBreadcrumb('Badge Flash Status to Reptrax: ' + _response); | |
console.log(_response); | |
console.log(_response); | |
} | |
}); | |
} else { | |
console.log("I AM FIRED ON processArgs url nothing"); | |
} | |
} | |
// He is getting console.log("I AM FIRED ON processArgs url nothing"); | |
on IOS 13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment