pushnotification signature into variable

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bohmgyorgy1990
Posts: 23
Joined: Wed Feb 19, 2014 2:33 am

pushnotification signature into variable

Post by bohmgyorgy1990 » Thu Apr 24, 2014 1:18 am

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

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: pushnotification signature into variable

Post by Klaus » Thu Apr 24, 2014 11:01 am

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

jiml
Posts: 339
Joined: Sat Dec 09, 2006 1:27 am

Re: pushnotification signature into variable

Post by jiml » Thu Apr 24, 2014 11:01 pm

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

bohmgyorgy1990
Posts: 23
Joined: Wed Feb 19, 2014 2:33 am

Re: pushnotification signature into variable

Post by bohmgyorgy1990 » Fri Apr 25, 2014 2:10 am

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

Post Reply