Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Looking for the best way to share a unique id/QR code

Author
Message
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 25th Sep 2017 12:58 Edited at: 25th Sep 2017 13:09
Sorry for the title of the thread. Managed to post accidentally before re-writing it. If a mod is free could they please amend it to something like this: "Looking for the best way to share a unique id/QR code that one user would share online or via WhatsApp/Messenger so that other users could load it"

For an update to an existing app I want to be able to allow a user to set up something on one device in the app and share it so that other users can load the same settings. The app already uses an online database so that would be the way to carry the data between two users but I'm not sure the best way to share it. I want to avoid text boxes at all costs as they just don't work well in AppGameKit so there's no chance of sharing a text string that a user can type in or copy and paste as AppGameKit doesn't have copy and paste on mobile devices.

One way I'm thinking is to create the settings on the device that would generate a unique id, store that id in the database (which I can do) and then create a QRCode image from that unique id that can hopefully be shared with the ShareImage function (haven't tried it on a device yet). I'm guessing the other user would either scan the QRCode if it was shared online by the first user or they would load the image if they were sent it and I'd use QRDecode to return the string and then find the match in the database to load the original settings.

I've written a few lines of code to QREncode a string, save the image, load the image, and QRDecode the image but I haven't been able to test it until later as my desktop at work doesn't have WiFi so I can't test it on the device or see if ShareImage works etc.

Is this the best way in AppGameKit? Are there other methods that I just haven't thought of?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Sep 2017 13:06
i believe it was possible to save a qr image in phone gallery and then open the image in other app and decode there.
AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 25th Sep 2017 13:12 Edited at: 25th Sep 2017 13:12
That was the way I was thinking of doing it and will test it out later on my device (specifically the ShareImage function), but if anyone has ideas on how to do it another way then I'd love to hear them.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Sep 2017 16:17
this way?
SaveSharedVariable ( varName, varValue )
LoadSharedVariable ( varName, defaultValue )
DeleteSharedVariable ( varName )
ShareText ( szText )
SetSharedVariableAppGroup ( group )
ShareImage ( szFilename )
ShareImageAndText ( szFilename, szText )

or if you can use web api or something maybe send to api controller with http commands, push notification, and after click your new app opens and download from wep api.
AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 25th Sep 2017 17:36
@Markus, Thanks. I'm assuming you're suggesting multiple ways in that list. I'm not sure how SharedVariable will work as it will be the same app but on different devices. And I've no knowledge of how to get text read into the app after it was shared with ShareText via Twitter or WhatsApp etc. because you can't copy and paste into text boxes. If you could the problem would be solved and that would be the easiest option. Having the user type them in isn't really something I'm keen on. I don't know how long the id's will be but probably 10 or so random characters.

With say the QR image or shareable text I imagine someone would share it on say twitter or on a website and any number of users might use that id at any time, days, weeks, or even months later. Ideally there would be 1000's of these shared (it would mean my app is doing well ) so things like push notifications wouldn't work. I wouldn't want to push a notification to every user each time something is shared.

I did look at app URI handlers (I think that's what they're called). URL's that open an app on the device and if I understood right could send data to the app opened but I couldn't even get the pages on my site to open the app on my device >.< I know AppGameKit hasn't been programmed to work with data sent via that way but that would have been quite handy if I could have shared a URL that has the id on the link that when pressed would open the app and do it's magic with that id.

ShareImage and QREncode/Decode looks like the option I'm going to have to go with, if it works. It's not a bad option!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Sep 2017 18:32 Edited at: 25th Sep 2017 18:33
jo, but what is the user id? mail adress that others services using allways?
me thought push notify just for transfer data from one device to other new device for same user.
i guess you will link people together with this qr codes, true?
AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 26th Sep 2017 07:43 Edited at: 26th Sep 2017 07:45
The app gives each user a unique user id when they first install, this allows me to link the data online with their device and helps with back ups etc. it's anonymous. It doesn't use email addresses and passwords to log in. While I could have set it up like a normal app with logins etc. I try to avoid using textboxes if I can.

The id I'm talking about and want to share would be an id that links to certain options that the user chose in the app and wants to share with others. It might looks something like this: xf37gp07y1rx. When the user loads this id that was shared, the app would download the settings from the online database matching up on that id and do something with it. That would then be the share completed.

ShareImage works, although it didn't give me the option to save to the device gallery. Probably not a big problem.

Here's a working example

Login to post a reply

Server time is: 2024-04-26 23:04:13
Your offset time is: 2024-04-26 23:04:13