Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 55

sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
12/07/15 10:35 PM (8 years ago)

Saving an image from the web into an app

I'm just planning how I'm going to solve this particular problem. Background: The app will be available to paid-up members of a non-profit. I want them to login. I then want their email address to be stored on the phone along with an image that I will generate on the server that will duplicate their membership card (barcode, name, expiry). I want it to be saved (for offline use) so that they can hit "membership info" on the menu list and be shown the image and in turn show it to others. Retailers offering discounts will expect the name to match the credit card name being used so there aren't any concerns about people sharing info etc, but the expiry date will be important. Requirement: Submit a form and return with an image that is automatically saved into the app and able to be recalled I'm happy to write code but my mobile app inexperience means I'd rather buy a plugin. Is this realistic?
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
12/07/15 11:50 PM (8 years ago)
Your requirement is realistic, however, it will need some custom programming to achieve it. If you are interested, please PM me here through forums.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/08/15 07:24 AM (8 years ago)
Routines for downloading files to the app are built into the BT infrastructure, albeit not well documented. Look at the BT_downloader files for the methods. Also built into the 'core' are simple 'user default' methods to store data/preferences. Keep in mind that once you compile your app, no 'new' data is going in; it all must be held in the cache. No big deal, unless they clear the cache. So you may want to consider adding a routine at startup that looks for specific 'critical' files (if there are any) and replace them if need be. Of course, the easier way is to let Dusko do it. :) Cheers! -- Smug
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/08/15 09:53 AM (8 years ago)
You might be able to achieve desired result with existing plugins: To submit the User's information, use the Webform Generator plugin. It allows you to send info to a Server (PHP, ASP, etc). The Server's good response would then have to be saved into UserDefaults. A bad response from the Server would show an error, try again message. https://www.buzztouch.com/plugins/plugin.php?pid=8C07FD3F661D4714558AA73 To display the info at a retail store, use the Webform Generator, but don't show any form fields. Only show the information and barcode sent by the Server's good response. Alternatively, use the Cubbyholes plugin to bring up that cached info. It will allow you to stylize the Membership screen. https://www.buzztouch.com/plugins/plugin.php?pid=9B9377C1CD78780457CD176 It's not an instant solution, there is a bit of coding to be done. In particular, what to do on good and bad server responses and the saving and retrieving of the cached information. A bonus is to add Geography information for the retail stores such that the Memebership Pass appears on the lock screen when in a particular locality. Similar to a Boarding Pass. In fact, supplement the app with an Apple Wallet pass? -- Niraj
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
12/09/15 02:11 AM (8 years ago)
Niraj, I need to keep my goals humble and get this baby to happen!!! Smug, thanks for the advice Dusko, I'll keep you in mind! Thinking it through I think I might be able to do it with a bit of tweaking of the standard login plugin and standard custom html screen so long as I can... * edit the login form to send the deviceId as a hidden field * edit the html screen to append the deviceId to the url that way my database can store the deviceId against the user's record when they login, then when they go to the "display the card" screen I know which device and therefore which user. Standard BuzzTouch will cache the "display the card" for offline use. When they're online it'll get refreshed which will help when it comes time to show the card as expired. Sane and Sensible? What do you think? FWIW: I'm actually a bit surprised that both options aren't there already. [deviceId] A globally unique string value assigned to the device.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/09/15 03:26 AM (8 years ago)
If you haven't already bookmarked it, a lot of useful info for sending data via the URL is here: http://www.buzztouch.com/docs/v1.5/mergeFields.php and of course, if you have questions, yell. Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.