1

I am testing out the new UNUserNotificationCenter to do some location based notifications (when a user goes within a certain area it shows an alert). I tested the code in the iOS 10 simulator changing the location to "Freeway drive" and it fires every time it approaches the trigger location. The problem is when I load it onto my physical device (iPhone 6) and do the same test is does not fire. I tried driving past it a few times while the app was open, closed. I print debug code to make sure notification are enabled and the notifications still exist and everything looks fine.. Is this normal for location notifications to be flaky or maybe a bug in the new iOS10 beta 3?

I adapted the code from this post: Add Local Notification in ios10 - swift 3

Update: I did more testing in the simulator and it is working with iPhone6s, iPhone6s Plus. It is not working with iPhone 6 (same as my physical device) and iPhone SE. Also tried "resetting the content and settings" in the simulator. It's very strange

Community
  • 1
  • 1
brk
  • 121
  • 1
  • 11
  • If you think it's a bug, file it with Apple! – matt Jul 24 '16 at 16:54
  • Yea will do! Just wanted to make sure it wasn't me doing something wrong. – brk Jul 24 '16 at 17:02
  • I haven't tried the new notification stuff yet, but you seem to have tested pretty well! Also I can't think of a significant difference between iPhone 6s and iPhone 6... – matt Jul 24 '16 at 17:09

1 Answers1

0

Okay i figured it out. On my test page, before bulk loading a bunch of notifications there was a "Serious application error" on my fetchedresultscontroller. Even though all the notifications were created successfully ( or seemed to be) after crashing they do not work. I can call "getPendingNotificationRequestsWithCompletionHandler" and still see all of the notifications are still there but they do nothing! I guess they are corrupt in some way.

brk
  • 121
  • 1
  • 11
  • nevermind, I can still reproduce the issue after fixing the crash, it's just not consistently doing it though. To me it just seems like a bug in ios10 beta 3. – brk Jul 24 '16 at 19:28