iOS - PassBook Automatic Updates - ios

I created a pass file and added in the wallet. I was wondering what am I missing that will show the Automatic updates option at the back of the pass ?
Like in this image : https://dxjl3qy52c1o9.cloudfront.net/wp-content/uploads/2016/03/22080644/ios-apple-wallet-share-526x1024.png
Back of my pass looks like this Image :
https://support.apple.com/library/content/dam/edam/applecare/images/en_US/iOS/iphone6-ios9-wallet-pass-auto-updates-inshell.jpg
I added the pass by two ways, one was manually by sending via email and other was adding pass file in the xcode bundle resources and fetching from there via code and adding using Passkit framework as mentioned in this tutorial: https://www.captechconsulting.com/blogs/ios-6-tutorial-integrating-passbook-into-your-applications
Do I need to have a server integrated to make that option show up ? As I read something of the sort in the apple documentation (https://developer.apple.com/library/ios/documentation/PassKit/Reference/PassKit_WebService/WebService.html#//apple_ref/doc/uid/TP40011988) and some other answers.
I am not trying to update the pass, I was just wondering for learning purpose why is that option is not shown at back of my own pass. If some one can clarfiy this, I would be very thankful.

You simply need to have a webServiceURL and authenticationToken in your pass.json to make the option appear.
For updates to work then you will need to implement the web service protocol on your server.

Related

Can I make a background data fetch in an external library?

I am currently making a SDK that would require fetching data in the background. For an example, let's say that the SDK provides some weather data that needs to be relatively fresh to be useful. At some point, the data is outdated and needs to be refreshed. The problem is, that the app might be often used in places with poor internet connection, or with no internet access at all. This brings me to the idea that maybe I should fetch the data in background, when the internet is accessible.
The SDK is packaged into a XCFramework, and distributed using Swift Package Manager. When I try adding capabilities to my target, Xcodes gives me a screen that states "No matches, Capabilities are not supported for SDK".
Is it even possible to make a background data fetch without the access to app capabilities? Or does this responsibility fall to the client app for my SDK? Sorry if the answer is obvious, I've tried searching online for a direct response to my problem, and wasn't able to find a clear answer.
An SDK/framework can't request such capabilities, but it can contain the code necessary to do all the work. You need to expose a function that the client can call to run this code.
E.g.
Inside your framework
public func setupBackgroundDataFetching() {
// create background task
}
Then inside your README, you need to tell users that they have to enable this capability and call:
let weatherSDK = WeatherSDK()
weatherSDK.setupBackgroundDataFetching()
Inside their AppDelegate. Depending on your use case you may need to have the function take in some parameters, or make a singleton class and have this as a static/class func, etc. But the basic idea is the same, wrap up the code and ask the client to invoke it
Example:
Heres the repo of a crash reporting tool I use: https://github.com/getsentry/sentry-cocoa
You'll notice their README contains installation/usage guide which asks users to run a setup method in their AppDelegate, which takes in a configuration. Based on this configuration, they can setup anything they need once the app starts, such as a background task if needed

GoogleAnalytics hit to wrong view

I have a problem. The sent data from the SDK mobile to analytics go to the wrong view. I'd like them to go to the type-view "APP" but they go to the website view instead. I've tried to set up the "APP" data source but it doesn't work. Screenviews are correctly send to the "APP" view but events are send to the wrong "website" view.
I use a basic POST call to send my events. My payload is similar to this:
"v=1&t=event&tid=UA-XXXXXY&cid=555&ec=video&ea=play&el=holiday&ev=300&ds=app"
How can I solve the problem?
First of all, the data is not stored in the views but in the properties.
Unless you have a very good reason not to, I suggest having separate properties for apps and websites. That means different tracking-IDs.
If you absolutely want to store both in a single property and don't want to see them in the same view, you'd have to look into Google Analytics Filters. Using filters, you can easily create separate views for app and web traffic.
This is how a filter that excludes all App traffic would look like:
More about filters on this link.

Apple wallet discount Personalized coupon dynamic serial number/barcode

I working on apple "passkit" framework.
I already build lolipop coupon as it saying in guide.
- Created Certificate (Apple Dev Website)
i already compiled .pkpass.
Now i have to build coupon with dynamic barcode/serial number (Personalized). I'm not able to figure out how can i inject my dynamic code in json because, whenever i do any changes in pass.json i have to compile ./signpass -p myfolder.pass to see changes.
Please advice.
If you want to dynamic code in pass.json, you need to create a Web API for pass update, you may refer to here. For more easy to develop or maintenance, you may update pass in every user request (just using http action result return a .pkpass file and status code 200)
I hope the following URL is helpful for you to understand how apple pass work:
http://www.raywenderlich.com/20734/beginning-passbook-part-1
https://www.raywenderlich.com/20785/beginning-passbook-in-ios-6-part-22
https://developer.xamarin.com/guides/ios/platform_features/introduction_to_passkit

iOS app that creates HTML5 content

I'm trying to do something a bit complicated and I'm not entirely sure how to go about it. Could you please give me some pointers on the tech I should use and how I should go about implementing this. Here's what I need to do:
Create an iOS app that allows the user to upload pictures from his camera roll and modify variables with sliders. (so far so good)
These variables and graphics are used to modify some htlm5 code (i.e. the graphics the user supplies are called by the hmtl code and the variables modify some set variables in the script) (Do I just edit the code as a string?)
The code is put together and uploaded to a server where it is accessible at a unique URL. The user can save multiple times and each time it creates a new URL. (Do I need an FTP here?)
Your question is too general, but as far as I can help, Yes you have to create and edit some html source texts, and append every object that user is adding to the page as some html codes, files, css, etc.
and for uploading, if you want the user to upload the site to his/her own ftp server or web hosting service, yes you need FTP connection to create with the server.
But if you want your user to upload the website to a space you're providing for the user, then you need some server part and maybe some APIs. then you may use FTP or even some APIs to create and update files on your server. It highly depends on the service you want to provide.

Updating a Passbook Pass using Ruby on Rails or an alternative?

I was wondering how I would go about updating my passes. I already know I need a webServiceURL (which I assume will be your IP address or one set on Ruby on Rails or something) and an authentication token. I'm more focused on how I would actually, physically update it. Is there an easy way out of this? Sort of like those iPhone app creating websites (but you don't professionally code it). I'm going to look into it more, but there aren't too many resources on the internet to choose from (that are useful).
If you are looking for a WYSIWYG, point and click solution, you might want to check out our service PassKit.
To see how updates work, you can start with this demo pass, flip it over and push yourself an update. You can import the template for the demo direct into the pass creator, edit it, and be pushing updates to your own passes within 5 minutes.
We also have a fully functional API that allows your to update and push a new pass your pass in a single call, E.g.
https://api.passkit.com/v1/pass/update/template/yourTemplateName/serial/yourPassSerial/push/?field_value1=newValue&field_value2=newValue2
If you want some code to get you stated, you can also access the source code to our pass creation pages.
If you are going to roll your own, I would use passbook-ios or something like that which is a Ruby Gem. If you want to use a service Urban Airship has one....though the pricing is a bit expensive at 10 cents a pass.
Lance

Resources