Creating Apple passbook webservice on linux without using XCode? - ios

I am able to make web pages that sign and create apple Passes for Passbook. The last thing I need to do is make the webservice, which allows the pass to check if it has changed or updated. If you define a webservice link in your pass's JSON it will query the location with RESTful get/delete commands.
I have never done RESTful things, so I looked for examples to dissect and implement. These are two notable ones below that I have tried -
https://github.com/ole/Kaffeekasse
https://github.com/tribbettz/passbook_rails_example
I don't know ruby either but that's not the problem, I tried installing both of them and they require xCode to proceed installation. xCode is Mac only and I am using linux. I am not sure why XCode is required. Apple documentation has no mentioning of needing it. I have a Mac for creating certificates but not a mac server. I asked the creator of Kaffeekasse if you need xCode for the webservice and he said no, but wouldn't explain why. This is a problem because it might suggest I need a Mac server just for this, because I don't see any non-xCode examples.
There is little documentation regarding passbook webservice and I am trying to host it on my own rather than pay a pass service provider that handles everything when I just need an update service.

Related

Apple Wallet update values dynamically

i have already created static version of coupon in apple device. now im want to update my new values directly on my coupon card, when value update in my database via API call.
i know this is possible just like boarding pass when seat number change it directly change on e-boarding pass.
please guys if you can provide good example links how to call API and how to fetches values from API and update coupon, it will be great help.
Note: My API will not be in objective-C.
Thanks
You need to implement Apple pass creation, distribution and updation code in your backend solution. Find the following references and documentations:
Apple Pass for JAVA backend :
https://github.com/drallgood/jpasskit
https://dzone.com/articles/ios-and-android-push
http://www.ryantenney.com/passkit4j/
Apple Pass Web URL specs:
https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html
Apple Pass for PHP backend :
https://github.com/tschoffelen/PHP-PKPass
Apple Pass with Ruby
https://oleb.net/blog/2013/02/passbook-tutorial/
APNS with Node.js :
https://solarianprogrammer.com/2017/02/14/ios-remote-push-notifications-nodejs-backend/
Push notification for updating iOS Pass :
https://stackoverflow.com/questions/15877496/how-to-make-a-push-notification-for-a-pass
Pass Kit Web Service Reference:
https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html
Important Note : If you are using any JAVA JAR, please check which server OS you are using, like IBM AIX OS (uses IBMX509) or Oracle OS (used SUNX509). Many libraries of Apple pass in JAVA is available which only support SUN JDK. You can land up into huge trouble in the last moment, if your server is AIX OS and JAR is using SUN.
For Eg: jPassKit JAR from https://github.com/drallgood/jpasskit only supports SUN JDK, so you can't use this for IBM AIX OS server.
I wrote an article about how to write the web services for apple wallet here: https://medium.com/#yangzhoupostbox/asp-net-web-api-example-for-apple-wallet-passbook-a124a1d90bb3

how to build a server service that supports iOS application

I'm kind of familiar with building iOS applications but I need some assistance.
I am trying to build a new application and I need some startup help:
basically, the application should have a log in screen via Facebook/google+.
A back-end server that stores data to be provided to the application's users. This server should push notifications each time a new data is uploaded to the server.
I know that the idea is so familiar and can be googled, but I need some kind of a start point, like resources, or what should I be familiar with before I start building the application. I also have no idea about the servers and how to build services.
Thank you so much
Since you seem to be a beginner, I would recommend checking out Parse. They have a nice iOS SDK to handle cloud data storage, server processing and push notifications. Tutorials can be located here. Best of all - It's free unless you have massive traction. (Which I am assuming you don't yet)
Parse handles third party logins too. Check this out.

How to pull init configuration and updated code in IOS application from backend server?

I am a new IOS developer. When designing the application, i figured that it will be probably wise to pull most of the configuration from the back-end server upon app init. In addition, i was thinking that instead of constantly upgrading the application (a hassle for users and developers) i might insert some way to update my code also on the system init.
my question - Is this approach do able? common? are there good practices for doing it (or best practices for that matter)?
Thanks a lot!
First welcome to ios programming
It is not a good practice to do so, and as far as I know it's not possible to change the code of your app after it's send to the appstore review team.
Before including your app in the appstore, Apple will create an executable file of your app which's code can't be changed.
You can use a backend service to provide different configuration options, example: you develop a chat on the app, but you want it to be shown when you change some config file on the server, so a web request to your server can be made to determine the content of the file and if has changed you could use a simple .hidden = false to unlock your chat feature
Hope it helps

Apple swift - How can an app connect to existing heroku/S3 database

Im new to iOS and new to SWIFT with no previous experience with Obj-C. But, Im not new to Ruby. I have a web based app on heroku and am beginning to learn SWIFT so I can build an iOS counterpart. I need to wrap my head around the bigger picture before I can get started and I can not figure out how these apps connect to databases.
Can an iOS app connect to an S3 database...and share that database with a website? Is there documentation on this process that I have over looked.
Connecting an iOS app to a public database would really be a bad idea - all server logic should be implemented on the client, and you would also need to hardcode database user name and password in your app.
A better way is to create a server app exposing a set of REST APIs and being responsible of dealing with the database. This way you can better control at server side what the app client is able to do on the database.
If you have an order entry app, for instance, you can create APIs to:
login
register
create an order
modify an order
add a contact
delete a contact
etc...
Some of the advantages are that:
in case you need to update the logic (but not the API interface), you just need to update the server, whereas in your scenario you'd need to release a new version of the mobile app
you control and limit how client apps access to the data (preventing for instance a user to access another user's orders)
if you want to develop the same app in another platform (android, ...), you reuse the same APIs
To get started, I'd suggest you to read the AFNetworking tutorial on raywenderlch.com, focused on a ios networking library, but talking about JSON, REST, remote APIs etc.
Next you have to choose a server side technology - the most popular nowadays is node.js - to get started you can read other tutorials on the same website:
http://www.raywenderlich.com/61078/write-simple-node-jsmongodb-web-service-ios-app
http://www.raywenderlich.com/61264/write-ios-app-uses-node-jsmongodb-web-service
if you don't want to use node.js and/or mongodb... the same architecture applies, just languages and technologies differ. Just transpose what you learn from there.
If you want to read about other languages to use at server side, just google for it - if you want to use ruby, try with ios rest api server ruby.
Note: I made no mention of swift because your question looks more like an architectural problem than a language specific problem. The tutorials I mentioned here use objective-c, once you've designed an architecture and chosen the language at server side, you can start looking into how to call REST API from swift.

Creating a unique-per-user passcode that cannot be employed by other users

I'm developing an iPhone game, and thanks to some backers, I got the funding for finishing it.
I wanted to give rewards to those backers with a "passcode"; they will simply enter the passcode and get rewards in the game.
Of course, any one of them would be able to distribute that passcode to the public...and that's a problem.
What is the best way to achieve something like this? Some kind of one-use password?
My first idea was to connect to a remote MySQL server from my game and check that password if it has been used before etc. But I was told that I shouldn't do that directly, that I need some kind of intermediate platform for it. So for the sake of simplicity, what are your ideas?
You could build some web services yourself to interact with your app. Alternatively you could choose a service that claims to do this for you - e.g parse.com. Have a look at the 'user management' section of the homepage of that site. I don't know how stable Parse is but it does look promising for what you want to do, if you don't want to spend a lot of time. There must be some alternatives out there as well.
Not certain but i dont think there is an MySQL driver handy for this architecture, so writing directly to a server on port 3306 is out of the question (as well as being a huge security risk for your server). I would probably write some simple rest API (in PHP), server side, and do a REST call to the server from the iOS app, a simple request-response over http(s). The response could probably be an xml file (aka a plist) that you could store in the Documents directory - your cue moving forward that the device has a privileged access to your goodies. The server would interface the MySQL to 'consume' the passphrase. PHP can be setup to be relatively safe (from SQL injections, and other 'bad' things).
These two tutorials by Ray Wenderlich demonstrate almost exactly what you want to do. Set up a MySQL database with a Php interface.
Part one:
http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app
Part two:
http://www.raywenderlich.com/2965/how-to-write-an-ios-app-that-uses-a-web-service

Resources