Handling Push Notifications when App is NOT running

When your app is not running or killed and you tap on push notification this function will trigger; – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions so you should handle it like this, UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; if (localNotif) { NSString *json = [localNotif valueForKey:@”data”]; // Parse your string to dictionary }

SwiftUI – Open a specific View when user opens a Push Notification

You need some sort of shared state that you can modify that SwiftUI knows to react to. An ObservableObject is perfect for this: class AppState: ObservableObject { static let shared = AppState() @Published var pageToNavigationTo : String? } Then, to listen to it and respond to it, you can do a couple different methods in … Read more

How to write an Apple Push Notification Provider in C#?

Working code example: int port = 2195; String hostname = “gateway.sandbox.push.apple.com”; //load certificate string certificatePath = @”cert.p12″; string certificatePassword = “”; X509Certificate2 clientCertificate = new X509Certificate2(certificatePath, certificatePassword); X509Certificate2Collection certificatesCollection = new X509Certificate2Collection(clientCertificate); TcpClient client = new TcpClient(hostname, port); SslStream sslStream = new SslStream( client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null ); try { sslStream.AuthenticateAsClient(hostname, certificatesCollection, SslProtocols.Tls, true); … Read more

Local and Push Notifications in IOS version compatible

IOS 12 :- Group notification set threadIdentifier UNMutableNotificationContent to create group notification create local notification group let content = UNMutableNotificationContent() content.title = “Group Notifications” content.body = “Body of notification” content.threadIdentifier = “group-identifire” create remote notification group need to pass thread-id in payload { “aps” : { “alert” : { “title” : “Group Notifications”, “body” : … Read more

Enable/Disable Apple Push Notification from iPhone app?

You can read your app’s permissions using UIRemoteNotificationType enabledTypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; and then performing a bitwise and operation with the different types to see which are enabled. You can also call unregisterForRemoteNotifications to disable notifications. The one thing you can’t do is turn on notifications, although you can direct the user.

iOS 13 Killing app because it never posted an incoming call to the system after receiving a PushKit VoIP callback

On this thread from apple forums, someone from apple staff explained this: On iOS 13.0 and later, incoming Voice over IP calls must be reported when they are received and before the didReceiceIncomingPush() method finishes execution, using the CallKit framework, or the system will terminate your app. Repeatedly failing to report calls may prevent your … Read more