Hy!
I would like to send my device's id to my own page. The pushnotification is working correctly. The problem is when i put this id into a variable (deviceID), i cant use it in a different command.
my code is the following:
local sBrowserId
global deviceID
on pushNotificationRegistered tSignature
put tSignature into deviceID -- put the id into a variable
end pushNotificationRegistered
on startBrowser
mobileControlCreate "browser"
put the result into sBrowserId
mobileControlSet sBrowserId, "visible", "true"
checkConn
mobileControlSet sBrowserId, "url", "http://192.168.0.139/Devices/Auth/" & deviceID -- concat the url and the variable in this case --- device id is null :/ why?
end startBrowser
on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if
startBrowser
resizeStack
end preOpenCard
can anyone explain me what i doing wrong.
Kind Regards
George
pushnotification signature into variable
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 23
- Joined: Wed Feb 19, 2014 2:33 am
Re: pushnotification signature into variable
Hi George,
are these three handlers in the same script (of the card of stack)?
And -> deciceID is definitively not empty?
And are you sure that "pushNotificationRegistered" is successfully
received/executed BEFORE "preopencard"?
Best
Klaus
are these three handlers in the same script (of the card of stack)?
And -> deciceID is definitively not empty?
And are you sure that "pushNotificationRegistered" is successfully
received/executed BEFORE "preopencard"?
Best
Klaus
Re: pushnotification signature into variable
Don't know if this will work but you might try putting the pushNotificationRegistered handler in the stack script.
And check that you have enabled push notifications in standalone settings > IOS
And check that you have enabled push notifications in standalone settings > IOS
-
- Posts: 23
- Joined: Wed Feb 19, 2014 2:33 am
Re: pushnotification signature into variable
all these scripts are on the same card.
deciceID is definitively not empty! ( put empty into it ? )
i am not sure that the pushNotificationRegistered executed before the browser was created in this code, for example when i put the pushNotificationRegistered into preOpenStack and i put the signature into a global variable also i cant get it in the card.
the standalone setting are okey, i can push notification just i cant post the deviceID in the url like in this sciprt
deciceID is definitively not empty! ( put empty into it ? )
i am not sure that the pushNotificationRegistered executed before the browser was created in this code, for example when i put the pushNotificationRegistered into preOpenStack and i put the signature into a global variable also i cant get it in the card.
the standalone setting are okey, i can push notification just i cant post the deviceID in the url like in this sciprt