Post not yet marked as solved
Hi! I'm totally new on iBeacons and I've been reading the official documentation about it on Apple's website.
https://www.cultofmac.com/270173/arent-people-freaking-ibeacon/LDzGJv7qcWDUcTYS.99
iBeacon on Apple
Getting started with iBeacon
https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html#//apple_ref/doc/uid/TP40009497-CH9-SW1
I understand that, as long as the app is installed, it is possible (since iOS 7.0) to detect when entering a region and manage to send a local notification to the user even when the app is totalle killed. The thing is that I can't find somewhere with an example that actually does that.
I've been able to monitor my beacon and identify when I'm near, far, etc. and if I entered or exited the region.. while on foreground; but I haven't been able to do anything when the app is killed.
I understand that the OS detects somehow that it entered the region and breefly wakes up the app just to let it know (which gives enough time to create a local notification), but I haven't find a reference to know which event is triggered or to what do I need my AppDelegate to subscribe.
I've enabled "location updates" and "uses bluetooth LE accesories" on background modes, I have the proper privacy keys on info, I do both startMonitoring and startRangingBeacons on a view controller but my AppDelegate is subscribed as an observer to certain events.
I would like to know if anyone here has an example or could point me to a nice direction to find out maybe which events on the AppDelegate get triggered or if I need to do something specific.
Thanks a lot for any help you could give me!
Post not yet marked as solved
Is there any way to change a notification to a ringtone
Post not yet marked as solved
So i’ve been testing voip calls of my app. One weird issue i noticed is that after few calls iphone stops receiving voip notifications. actually not just voip notifications but notifications from every other apps.
i have two wifi networks at my home. when i switch from one network to other then suddenly voip notifications starts working and if there were any pending notification from other apps then those arrives too as soon as i change the network. Again i test calls few times and it works. then again same issue. if voip notifications doesn’t works then i just switch the network and notifications works.
wondering if its iphone issue or ios or the router configuration thats delaying or preventing the notification from coming in.
Post not yet marked as solved
I'm Facing an issue when i Debug Project in Real Device, I'm Getting Notification With Custom Sound, But After making a Build Via Diwai, I'm Not Getting Custom Sound, It Play Default Sound with Notification.I'm Using Firebase. I have Added Custom Sound in Project and added in Bundle Resources as well. Please Have A look on My Code.
Here's My Code
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let content = UNMutableNotificationContent()
content.sound = UNNotificationSound(named:UNNotificationSoundName(rawValue:
"EigenIntro.caf"))
FirebaseApp.configure()
Messaging.messaging().delegate = self
if #available(iOS 10.0, *) {
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: { _, _ in
}
)
} else {
let settings: UIUserNotificationSettings =
UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
application.registerUserNotificationSettings(settings)
}
Messaging.messaging().token { token, error in
if let error = error {
print("Error fetching FCM registration token: \(error)")
} else if let token = token {
print("FCM registration token: \(token)")
}
}
application.registerForRemoteNotifications()
return true
}
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
print("Firebase registration token: \(String(describing: fcmToken))")
self.sendDataToServer(token: fcmToken!)
}
func userNotificationCenter(_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions)
-> Void) {
let userInfo = notification.request.content.userInfo
print(userInfo)
completionHandler([[.alert, .sound, .badge]])
}
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
print(userInfo)
completionHandler()
}
func application(_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.hexString
print("APNs Device Token: \(token)")
Messaging.messaging().apnsToken = deviceToken
Messaging.messaging().setAPNSToken(deviceToken, type: .prod)
}
func application(_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Messaging.messaging().appDidReceiveMessage(userInfo)
completionHandler(.noData)
}
Post not yet marked as solved
Hi Team,
We are trying to connect with our .pem file to apple, for testing pushnotification and here our UseCase
Send - Connection
Send -> Block
a few minutes later
Send -> Connection
Send -> Block
where
Block = connection refused, so it failed to even "connect" to apple
We also notice that the DNS resolved to many different IP addresses. Some work, some block
some IP addresses send us reset packets which means we get connection refused and some complete the TCP handshake and work.
When is the old SSL push notification supported up to before we have to swap to HTTP2?
we are trying to work out IF this is still supported?
any help would be appreciated
Thanks in advance.
Post not yet marked as solved
We have tried all the suggestions on iPhone settings for iOS 15 and double checked code base as well as APNS payload. We have not sound on push notifications and don't understand what has changed. Our code base worked on previous iOS version on previous Apps. Is there a new way of getting sound in push?
Post not yet marked as solved
For my iOS app - when I set same thread-id for grouping and apns-collapse-id same for multiple notification, it works (notifications get collapsed). When I try same apns-collapse-id with different thread-id collapsing doesn't work. How are both related. I have debugged to make sure the values are correct
Post not yet marked as solved
We are using communication notification to update notification icon, but for us it's not working for xamarin project.
var handle = new INPersonHandle("unique-user-id-1", INPersonHandleType.Unknown);
var avatar = INImage.FromName("abc.png");
var sender = new INPerson(handle, null, "Example", avatar, null, null);
var intent = new INSendMessageIntent(null,INOutgoingMessageType.Text,
"Message content",
null,
"unique-conversation-id-1",
null,
sender,null);
// Use the intent to initialize the interaction.
var interaction = new INInteraction(intent: intent, response: null);
interaction.Direction = INInteractionDirection.Incoming;
interaction.DonateInteraction((error) =>
{
// ...
});
NSError error1 = null;
var content = request.Content;
var updatedContent = content.Update(intent, out error1);
contentHandler(updatedContent);
Post not yet marked as solved
On iOS14 or later, the body of push notifications is cut off at around 256 characters.
For iOS13 or earlier, the entire body was displayed normally and the issue did not occur.
Do you have any idea of the cause, such as a change in Apple's APNs or OS specifications?
There is a limitation that "APNs support only 4096 bytes for the entire payload of a push message," but the notification size when an event occurs is 4096 bytes.
We have confirmed that the size of the notification when an event occurs does not exceed 4096 bytes.
Are there any other restrictions on the number of characters used to send push notifications?
Post not yet marked as solved
Hello,
When attempting to assign the UNNotificationResponse to a Published property on the main thread inside UNUserNotificationCenterDelegate's method
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async
both Task { @MainActor in } and await MainActor.run are throwing a NSInternalInconsistencyException: 'Call must be made on main thread'.
I thought both of them were essentially doing the same thing, i.e. call their closure on the main thread. So why is this exception thrown? Is my understanding of the MainActor still incorrect, or is this a bug?
Thank you
Note: Task { await MainActor.run { ... } } and DispatchQueue.main.async don't throw any exception.
Post not yet marked as solved
Notification to my app stopped working recently. According to the server response the message was delivered without errors but nothing is going through on device.
We are using a Push Notification Key to send Notifications.
I have recently migrated my account from Personal to Business. Not sure if that had an influence.
I also did create a new key but that also did not make any difference.
It seems that on iOS 16, image previews on push notifications are no longer visible. There used to show a small preview in a square to on the right side of the notification, but now the only way to view an image preview is to press and hold the notification (there is no indication which notifications have images without pressing and holding them!).
Is this a bug or expected behavior? It seems ridiculous to drop support for this.
Post not yet marked as solved
Hello,
I have been searching for documents related to Safari push notification configurations. I have found this one below, but it is archived and not sure whether it's still reliable.
Up-to-date documents are mostly redirecting to upcoming Safari version (Safari 16 which will support push notifications in a different way). Was just wondering if there is an updated version for the document below, or if its still reliable as a guide for sending pushes to Safari versions below 16.
https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1
Post not yet marked as solved
When creating a new Multiplatform project on Xcode 14 beta and adding a Notification Service Extension Target, compilation fails with:
error build: Your target is built for macOS but contains embedded content built for the iOS platform (Notification.appex), which is not allowed.
This really limits the usefulness of the new multiplatform single target, especially if we cannot incorporate basic extensions.
Is there any way to use single target multiplatform and still have the freedom to add necessary extensions to the app?
Post not yet marked as solved
I add my notification with
UNTimeIntervalNotificationTrigger(timeInterval: 30*60, repeats: false)
So I expect that my notification should be delivered after 30 minutes from current time.
If I change time zone on my phone - all works correct.
But If I change time manually, for example + 1 hour - then my notification is delivered to me at the time of change.
Is there some way to handle this behaviour or is it expected?
May be there is some documentation where describe this behaviour?
Thanks in advance.
Post not yet marked as solved
We use remote push notification with content available = 1, as per document it will wake up app, but it doesn't work properly, sometimes the app doesn't wake up.
I have observed this behaviour mostly on iOS 15.
We use this mechanism to send device location to our server.
Why remote push notification doesn't wake up my app all the time?
Post not yet marked as solved
Hi
I piad for my account yet Im getting this message when using trying to activate Push Notifications for my project.
please Advise
Thanks
Right after I receive a notification I want to execute a background task.
I'm using firebase to receive notification.
I can receive notification successfully with 'UNUserNotificationCenter' in the AppDelegate file.
Now my goal is to send a "GET" - "PUT" request, right after I received a notification (only when the app is in background)
I saw the documentation about Background Tasks: https://developer.apple.com/documentation/backgroundtasks
But I can't found a way to execute a background task right after I receive a notification.
Is anyone has any suggestion about that? Thank you
Post not yet marked as solved
We use remote push notification with content available = 1, as per document it will wake up app, but it doesn't work properly, sometimes the app doesn't wake up.
I have observed this behaviour mostly on iOS 15.
We use this mechanism to send device location to our server.
Why remote push notification doesn't wake up my app all the time ?
Post not yet marked as solved
I tried to setup custom text for my app's push notifications permission alert by setting the NSUserNotificationsUsageDescription key in the info plist. It works flawlessly when I run the app on simulator, but running the app on a physical device still shows the default text provided by Apple. Is this a bug by Apple or am I doing something wrong? I am trying this with Xcode 13.4.1.