Push Notifications for Apple Watch - push-notification

From what I've understood (which could be completly wrong and therefore this post will make no sense), I need to create separate APP Id's in my developer portal for my Watch app/extension.
I did that, and I now have 3 app ID's and their complete related set of provisioning profiles up and running.
The archive works fine and I'm about to submit but, I see that because there is an app ID, I can link a PUSH Certificate (apn). Since the Apple Watch doesn't really get notified, but the phone does, do I really need to create specific certificates for the apple Watch ? And use their related .p12 wherever I would need them (parse.com for example) ?
Or can I simply ignore that and keep the regular phone certificates ?
Thanks

If you already have push notifications set up properly for your iPhone app, they will be delivered to the Watch automatically. You don't need to set up any separate certificates.
Docs: https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/BasicSupport.html#//apple_ref/doc/uid/TP40014969-CH18-SW1
Additionally, I have deployed a number of apps already and have first-hand experience.

Related

Use guid to register instance of xamarin forms app

Good day fellow code ninjas,
I am attempting to make my Xamarin forms application be device unique in the sense that you are not able to login with your credentials on any device other than the one you initially installed the application on.
I have deduced that I should be using a guid for this purpose. I have searched online but I'm not able to find much of a guide on how exactly to use a guid to recognize a specific device.
Are there perhaps any resources related to this or any examples of code used to accomplish this?
There are a few layers to this question, firstly:
Can I Uniquely Identify A Device? No
You won't be able to get truly uniquely identifying information about the device such as UDID, IMEI. This is enforced by the platforms (iOS & Android) as a way of protecting users sensitive information.
This process is called Fingerprinting. There are 2 cases that the platforms want to avoid: Advertisers tracking users across apps, Malicious use of unique id's to target a user. In older versions of iOS & Android there were more API's to use to uniquely identify a user but they are being phased out as privacy & security have become greater concerns for mobile users.
What Are My Options?
Lets accept that we can never truly uniquely identify a device, there are some tricks we can use.
Secure Storage
You can generate a guid and place it in secure storage on the devices keychain. This keychain value can be persisted even if your app is uninstalled. You could use this approach to check if the app is unique to the user. There are pitfalls with this approach, it's not perfect but it's the approach myself and many other's use.
It is worth mentioning the behaviour across devices is very inconsistent. The iOS keychain can be backed up to iCloud (if encryption is enabled). Android devices can use slightly different standards across API levels & vendors.
iOS - identifierForVendor
iOS will generate a guid when you install an app, you can use this value instead of generating your own. See the documentation here.
The 2 drawbacks here are you'd need to implement this on a platform level and if they user deletes all of your apps, the guid gets deleted and a new one is generated when they reinstall the app:
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.
Edit 1:
Add further clarification: Explain fingerprinting & highlight some platform nuances

WKRefreshBackgroundTask for CloudKit on watchOS?

So, on watchOS, I know you can schedule (and reschedule) a WKRefreshBackgroundTask to do work for you in the background. This is great for my app to make sure that data is current and up-to-date on watchOS - especially since it doesn't receive updates like iOS and macOS.
Except, my data uses CloudKit to store a user's data.
I want to use something like the URLSession scenario, where you schedule a WKApplicationRefreshBackgroundTask where you create a background URLSession task and hand it to the system. The system in turn hands you a WKURLSessionRefreshBackgroundTask where you check if your data completed its URLSession (by checking if the downloaded data exists).
My question is, how do you do something like this with CloudKit?
I could just do the downloading of my user's data in the WKApplicationRefreshBackgroundTask, but I don't think I'm guaranteed it will finish in the time the system gives to my app. This is why (it seems) Apple recommends you split this into two Background Tasks:
WKApplicationRefreshBackgroundTask - to create the URLSession and hand it to the system.
WKURLSessionRefreshBackgroundTask - to act upon the data downloaded from step 1.
I am not sure you can do this with CloudKit? Or, at least I can't seem to find something of the sort.
If you want to use WKURLSessionRefreshBackgroundTask you have to access the iCloud database via URLSession. This is possible from an app but much more complicated.
iCloud web service documentation
send a web request to iCloud from a swift app
Don't forget to get your API request token for your database on the iCloud dashboard if you want to try it out.

Sending pictures from photobooth to phone via WeChat

My boss has charged me with the task of finding how to integrate WeChat into our photobooth's "Total Share" section.
Our photobooths work under windows and their software is a mix of Java and a PHP web API installed locally, that then connects to a web service.
The intention is to give the user the option to, when their picture is done, get a copy of it via WeChat (I guess that by introducing it's phone number)
Through my searches I've found a WeChat JS-SDK, but that seems to connect sites you are watching on your phone with your actual WeChat app so it doesn't work in my case.
The other source I have found is the Official Account Admin Platform, but I'm not really sure if this would allow me to do what I need. As far as I've seen, the Official Account can send messages in response to a trigger (that would work for me, send a message when the user clicks on the button), but it also seems to need that they "subscribe" (in a way) to the Official Account, and secondly I'm not sure how can this be automatized.
Especial mention:
I'm a junior developer, so API integration is a bridge I haven't crossed yet, and as such I'm utterly lost.
Is it possible to get the functionality I require? If so, what are the steps to do it?
You don't need to make a fully fleshed tutorial to write an answer, just knowing in what direction should I go, and maybe some possible caveats that more experienced developers may be able to foresee, would be great.
Thanks.

iTunes search api not returning keyword results in the same order as iOS App Store

I'm trying to do some SEO and I want to index the location of an application based on keyword searching. By using the official search API, I've come up with the following query:
https://itunes.apple.com/search?media=software&term=sql+server&limit=&country=us&limit=200
To search the US App Store, for the term sql server. The app I am looking for current shows up in this list at position ~20'th. If I search from my phone, the app is closer to the ~30'th position (other search terms perform even worse). I have tried to use Wireshark to capture the search from my phone to try and see if they use different endpoints, but was unable to capture due to ssl.
Does anyone know of a way to scrape iOS App Store search results in the proper order?
Apple is under no obligation to return search results in any particular order, and is likely to change them depending on client/what search cluster you hit.
Seeing what your phone is sending to the app store is very difficult, however, as Apple takes excessive measures to ensure that communications aren't being read. Last time I tried required BURP Suite, a jailbroken phone, an app to disable SSL pinning, and manually restarting the app store on the phone, which would occasionally crash it.
Set your user agent to replicate an iPhone device browsing the App Store.
Try this one... This is the most recent App Store version, emulating an iPhone X with iOS 11.3.1:
AppStore/3.0 iOS/11.3.1 model/iPhone10,6 hwp/t8015 build/15E302 (6; dt:162)

Firebase doesn't completely sync when offline client comes back online

When an online client (a desktop) and an offline client (a phone) both enter data, and the phone is brought back online, the phone does not receive the data posted on the desktop during the offline period.
To duplicate, in an empty directory, run firebase bootstrap, enter the name of your app, and choose the react template. Then do firebase deploy and firebase open to visit the page in the desktop browser. Then visit the same page in the phone browser.
Begin entering data alternately in the React + Plain Firebase pane of the desktop and phone browsers. Enter '1' on the desktop, '2' on the phone, '3' on the desktop, etc. So far the series displays 1 2 3 on both browsers as expected. Then put the phone in airplane mode and continue entering numbers alternately. Now the desktop shows only the odd numbers that are being added, and the phone shows only the even. This is also expected.
Now bring the phone back online. The phone will push its data to firebase and the even numbers will show up on the desktop (although oddly in a different order in the React + Plain Firebase pane and the React + ReactFire pane).
But the odd numbers do not show up on the phone, until the app is reloaded. Is this expected? Is there a way to force a complete resync in when a client goes online?
UPDATE: Other questions I have seen on firebase offline usage have been about detecting presence, user auth or other more complicated scenarios. My case is simpler. The docs say:
Once connectivity is reestablished, we'll receive the appropriate set of events so that the client "catches up" with the current server state, without having to write any custom code.
To me, this means that syncing should "just work" without the necessity of the app "knowing" whether or not it is online or doing anything special when it goes online.
I was also assuming that firebase offline data storage is persistent, but Kato's recent comment to this question indicates that it is not. So I guess the answer is that Firebase's offline storage implementation is incomplete, and its limitations are not well documented.

Resources