I am wondering if I can use AutoFill without implementing the Associated Domains?
So this means for example that when the user register in my app that I save the credentials.
And then when he tries to login offer this credentials as AutoFill option.
Is something like that even possible to achieve?
As far as I can tell, you can take advantage of AutoFill without setting up associated domains. The part you'll miss out on is that iCloud/1Password/etc. won't be able to suggest the right log in details for your app without the associated domains set up. Instead, it'll prompt the user to choose/search for the matching log in details and select them from a list. But it should fill it in for you fine, especially if you add the extra details like setting textContentType on your text fields so iOS knows what's a log in form in your app.
ETA: Actually, I ended up having issues with AutoFill in my app that seemed to be fixed by setting up associated domains. The documentation makes it seem like that step is optional, but I had trouble where 1Password would let me choose the log in details but not fill them into the text fields until I had associated domains set up, whereas iCloud seemed to work fine mostly.
Related
I may be searching for the wrong thing, which might explain why I can only find information on setting up password autofills.
I'm looking for the ability to for a user to enter email, phone, first + last names in an app, the same way some websites are able to do it, the options appearing above the keyboard.
I have the fields content type set in the storyboard (Name, Telephone Number, Email Address)
Can anyone advise if this is possible and how I go about doing this.
Password Autofill is the only feature that automatically does that on IOS Apps.
The other feature you are talking of "Contact Auto Fill" that you say happens on some websites on your mobile is a feature implemented in the Safari App.
If you go to your IOS settings and open Safari Settings, you'll see you can select a contact to use for contact and credit card autofill.
Safari Settings Screenshot Safari Settings Screenshot2
To get such a feature, you would have to manually implement.
Automatic availability of such feature would probably have privacy concerns to user (meaning you can auto extract true user contact information by just making such a form in your app).
I'm creating a settings bundle for my app to allow users to set their default application server. How should I be validating the user input for a Text Field in the settings?
I've found this post from 6 years ago, and also have read through the apple docs and realize there is no mention of input validation.
There is no way to do input validation for stuff in settings.bundle while the user is typing. You'll need to do this when your app starts, and/or in response to the UserDefaults.didChangeNotification notification, and there's no really good way to provide user feedback.
That said, there are 3rd party libraries out there that allow you to move this stuff from the system's settings app into your app directly, making it much more easy to access, and also allow a high degree of customisation, in particular https://github.com/futuretap/InAppSettingsKit.
I am currently working on an app that is going to use the users iCloud information, namely first name, last name and e-mail address as a way to automatically sign-up for the app, instead of filling out a huge form.
Currently the only way I see to get to this information, is to ask the user for permission using the only CloudKit permission type available (userDiscoverability).
CKContainer.default().requestApplicationPermission(CKApplicationPermissions.userDiscoverability, completionHandler: { (status, error) in
....
})
The problem with this is, is that the definition of userDiscoverability is:
The current user is discoverable (through the user's email address) to
other users of the app
Which leads to the default dialog shown here:
The problem is, is that I want access so that i can use the information above to sign someone in automatically (and use it for when someone changes devices, loses their device, etc) so that they don't have to sign up again. Therefore the dialog shown here isn't relevant to what I need it for and the users of the app are going to be confused as to why other users of the app will see that they are using the app(and in fact there is no functionality in the app to allow this at all anyhow).
Like other privacy entries available in Xcode, is there one available somewhere for CloudKit where I can add my own custom message so that I can customize the reason I need permission?
I know that others people have offered solutions, like providing your own custom dialog before the system asks or providing a Page View Controller to explain what's going on but I would like to avoid that. Apple really needs another permission type here but for the time being, thats all we have.
Suggestions/Comments/Feedback welcome.
After registration, our app prompts users to invite her friends (aka phone contacts) to use the app too. This allows us to send an email/sms to the useer's contacts with some sort of invitation key. Works fine for a web version app, just embed the key in the url you provide in the invitation.
I'm having trouble figuring out how to make this work smoothly with IOS only. It would be brilliant if I could send the invitee a link to appstore.apple.com/myapp?registrationKey=abcXYZ and have the key magically available to my app once it's installed, but I guess this is a lot to hope for?
The obvious way around this is to make the user manually enter their registration key on first launch, but this seems less reliable and (to my mind) adds friction to the UX.
Has anybody come up with something clever to get around this?
Here is what is flowing through my brain on how to solve this solution, please note, I have not vetted, psudeo-coded, coded, or applied this theory.
Since you will know who is being sent an invitation, save that data to your database with a relationship to the user sending and a unique id to the user being invited (email address if its in the contact's card). When new users sign up scan the database for invitations, if one is found present it to the user asking We're you referred by <existing user>? Once the new user selects their response continue through the registration process, updating the relationship table accordingly and applying any extra settings you need to for the referral.
This combines automatic referral tracking with referral codes for a basic, straight-forward, almost (but not quite) fool proof method to make sure referrals are linked to the right users.
As far as I can tell, the App Store provides an information firewall between an invitation and the installed app.
The closest workaround I've seen is the following:
email link sends you to your website
the website logs reference information in the URL and the IP address
the website instantly redirects you to the App Store (if iOS detected)
user installs the app
user loads the app
app contacts your website, IP addresses matched ... BINGO
Obviously not a secure method though.
There are many failure cases:
business networks commonly share IPs
home and mobile networks release and reuse IPs
The more is frequently used to resolve cases where its good enough to know that the user 'almost-certainly' was referred to download app by the email.
For example, it can be a good mechanism to prompt the user with a "who do you know" question in an app and limit the options based on the (IP+reference) data. If they pick the original poster, then maybe that's good enough, and then you can attach any other data that the inviter provided.
(Full disclosure, currently work at Branch)
The best solution to this is to fingerprint a user. This requires you to do the following steps:
For each user, using your own domain, generate a link for said user. So, right when they complete registration, generate their unique URL, that contains the invitation key.
For anyone clicking this link, they will redirect to Safari first. When they do, capture their IP address and iOS operating system version from the headers and user-agent.
Save this data on your server, and set window.location to your iTunes url.
If the user downloads and consequently opens, inside AppDelegate.m, send a message to your server with the IP address + major/minor/min version you collect upon app launch. If it matches with what you have on the server, you can now pass that invitation key back to the new user.
It's not perfect, and has the ability to misattribute. You could also use branch.io, where all of this is taken care of (link-generation, fingerprinting a user, attribution). Branch also drops a first party cookie and ties it with the device level ID, so attributions are much more accurate.
Not exactly a programming question but here it goes:
How can a company who is distributing passbook passes via email or web prevent a pass from being installed on more than one device?
I can not find anything about this on Apple docs. The only I can think of is to check on the device registration webservice whether the combination of pass type and serial has a device already registered and delete it , but I am not aware of any command to delete the pass remotely.
Another option would be to check if it is already registered prior to generating the pass but this would only work for URL distribution, not for email.
Is there any way to delete a pass remotely via push notification + update? Any ideas on how to solve this issue?
Mail and Mobile Safari will present any pass they are given and the user can decide to add them to their Passbook. There is nothing the pass creator can do to prevent it except to be careful about how the .pkpass files get handed around.
If you really only want to deliver a specific pass to a specific device you might consider a companion app that uses a custom API to communicate with the the backend and request the pass for that device that way. Then you have much more control than distribution via email or url links.
Apple frowns on trying to delete a pass programmatically; only users are supposed to delete passes because they added them. You can, however, update a pass to make it clear that is not valid and should be deleted. For example you can remove the bar code, if any, and use a background image with a big red "INVALID" on it.
Just to extend #ohmi's answer:
You cannot prevent passes from being installed on more than one
device - e.g. if user enables iCloud for Passbook, the passes will get
synced automatically across devices.
Considering your links to pkpasses are public, you may want to consider
introducing one-time download links, but while it can fill your
needs just fine, users can be really disappointed if it's impossible to re-add
passes that they manually deleted. So I wouldn't recommend such solution.
You can make you pkpass links kind of private, so only GET request originating from your application and carrying a specific value for specific header field (e.g. auth_token), will receive a pkpass file, however this way you almost disable pass distribution via email or via sharing URLs to passes and make pass updating probably impossible.