iOS. Add to Passbook with Alert Dialog - ios

Please, advise how I can create alert dialog, similar to Starbucks, shown in the image, when add to Apple Passbook.
I've tried to use PKAddPassesViewController, but failed, as it wasn't clear how to get alert dialog.

This looks like they are presenting a standard UIAlert before presenting the user with a PKAddPassesViewController.
It is not possible to directly replace the Add/Cancel buttons of the PKAddPassesViewController with an alert.

Related

iOS: Dismiss presented ViewController which is an instance of specific Class

I am using NYAlertViewController to display dialogs in my iOS-App. It can happen that I just opened a dialog when a background process tries to trigger another dialog. If this happens, the second dialog is not shown. I would like to close all other dialogs before opening a new one. How could I do this?
The Dialogs are shown with presentViewControllerAnimatedCompletion.
Maybe I can dismiss all ViewControllers that are instances of NYAlertViewController?
Any thoughts on that? Thanks!

IOS notification content extension: add buttons in storyboard and handle the click action

IOS notification content extension: add buttons in MainInterface.storyboard and handle the click action without dismissing the notification
after making some research I discover that:
can not handle buttons clicks in the IOS notification content extension, only the type of button can be used is the media button, see the IOS documentation:
https://developer.apple.com/documentation/usernotificationsui/unnotificationcontentextension
The up answer is not correct, you can just add UNNotificationExtensionUserInteractionEnabled YES to the info.plist, then you can do every thing just like a common viewController
As Abdullah S. Al-Hallak said, it is not possible to perform actions that will lunch a certain screen. In Apple documentation, it is mentioned that "Do not install gesture recognizers or rely on touch events in your interface."
The only possible way is to add actions that will do some things in the presented notification only (like animation, as presented in this cool post: Adding a Custom UI and Interactivity in Local and Push Notifications)

Custom dialog for enabling push notifications (iOS)

Is it possible to present a custom dialog and not present the default dialog "(AppName) Would Like to Send You Notifications" (seen below)? So when the user presses the custom dialog button "Enable Notifications" it allows notifications w/o presenting the default dialog? I dont want to present the user two dialogs.
No this is not possible, the dialog is coming from iOS and not your app.
And there is a good reason for it, security. The dialog is present by the system not you app. This is done so you can hack it so the user always accepts.

Change system generated alerts into Custom Alert

Can we show the system generated alert, like permission request and in app purchase popups as shown here into customise view?
If yes Please explain How can we achieve it?

Need info on handling system notification on iPhone in automation

We initiate pairing with iPhone,
On iPhone a notification “Do you want to pair with this device” with 2 buttons “Pair” and “cancel” is displayed.
I need to click on this “Pair” button.
I notice that this notification displayed is not part of the any mobile (iPhone) application instead its system notification.
With the current tool, I am unable to click on this “Pair” button, hence can you please suggest an automation tool for iPhone which can perform click on this “Pair” button displayed as part of system notification?
its true you can not click buttons on alert and notification with inbuild automation. automation have inbuild functionality which cancel notification and alert by click on cancel
If you are using Instrument tool provided by apple then also it is possible to tap on "Pair". Only thing you need to do is register a callback for alert before your alert come. So limitation with this is if your alert come at starting point only then it is not possible with this tool but if this alert comes in between then definitely you can tap on "Pair".
You can see in UIAutomation doc hon how to register a callback for alert.
If not able to then I can help you more.

Resources