iOS10: I cannot get currentUserNotificationSettings after getting push notification
up vote
3
down vote
favorite
I'm developing app using push notification, and I had an issue on only iOS10 devices.
I can get currentUserNotificatoinSettings.types during the first launch.
[UIApplication sharedApplication].currentUserNotificationSettings.types;
But after I got pushNotification, the thread, which read currentUserNotificatoinSettings.types, froze without any exceptions.
Somehow I tried to get exceptions by using @try@catch, breakpointNavigator in Xcode, or Zombies on profiler, but it doesn't show any exceptions.
How should I debug this issue? or does anyone know what the cause of this issue is?
ios objective-c push-notification ios10
add a comment |
up vote
3
down vote
favorite
I'm developing app using push notification, and I had an issue on only iOS10 devices.
I can get currentUserNotificatoinSettings.types during the first launch.
[UIApplication sharedApplication].currentUserNotificationSettings.types;
But after I got pushNotification, the thread, which read currentUserNotificatoinSettings.types, froze without any exceptions.
Somehow I tried to get exceptions by using @try@catch, breakpointNavigator in Xcode, or Zombies on profiler, but it doesn't show any exceptions.
How should I debug this issue? or does anyone know what the cause of this issue is?
ios objective-c push-notification ios10
Are you getting some Exception when iOS decode the payload in push notification?
– orafaelreis
Mar 27 '17 at 17:18
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm developing app using push notification, and I had an issue on only iOS10 devices.
I can get currentUserNotificatoinSettings.types during the first launch.
[UIApplication sharedApplication].currentUserNotificationSettings.types;
But after I got pushNotification, the thread, which read currentUserNotificatoinSettings.types, froze without any exceptions.
Somehow I tried to get exceptions by using @try@catch, breakpointNavigator in Xcode, or Zombies on profiler, but it doesn't show any exceptions.
How should I debug this issue? or does anyone know what the cause of this issue is?
ios objective-c push-notification ios10
I'm developing app using push notification, and I had an issue on only iOS10 devices.
I can get currentUserNotificatoinSettings.types during the first launch.
[UIApplication sharedApplication].currentUserNotificationSettings.types;
But after I got pushNotification, the thread, which read currentUserNotificatoinSettings.types, froze without any exceptions.
Somehow I tried to get exceptions by using @try@catch, breakpointNavigator in Xcode, or Zombies on profiler, but it doesn't show any exceptions.
How should I debug this issue? or does anyone know what the cause of this issue is?
ios objective-c push-notification ios10
ios objective-c push-notification ios10
asked Jan 2 '17 at 14:08
Y.Okano
161
161
Are you getting some Exception when iOS decode the payload in push notification?
– orafaelreis
Mar 27 '17 at 17:18
add a comment |
Are you getting some Exception when iOS decode the payload in push notification?
– orafaelreis
Mar 27 '17 at 17:18
Are you getting some Exception when iOS decode the payload in push notification?
– orafaelreis
Mar 27 '17 at 17:18
Are you getting some Exception when iOS decode the payload in push notification?
– orafaelreis
Mar 27 '17 at 17:18
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
You should access UIApplication methods only from on main thread. Wrap your code that accesses the notification settings in a dispatch_async(dispatch_get_main_queue(), ….
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
add a comment |
up vote
0
down vote
I have just solved same problem on iOS 11.2.6. I provide my system callstak when the app is stuck.
In my case, currentUserNotificationSettings called synchronously on main thread, not asynchronously. So that maybe causes deadlock.
I don't know why this is not occurred in iOS 12. But I hope this can help you. Thanks.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You should access UIApplication methods only from on main thread. Wrap your code that accesses the notification settings in a dispatch_async(dispatch_get_main_queue(), ….
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
add a comment |
up vote
0
down vote
You should access UIApplication methods only from on main thread. Wrap your code that accesses the notification settings in a dispatch_async(dispatch_get_main_queue(), ….
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
add a comment |
up vote
0
down vote
up vote
0
down vote
You should access UIApplication methods only from on main thread. Wrap your code that accesses the notification settings in a dispatch_async(dispatch_get_main_queue(), ….
You should access UIApplication methods only from on main thread. Wrap your code that accesses the notification settings in a dispatch_async(dispatch_get_main_queue(), ….
edited Jan 2 '17 at 14:18
answered Jan 2 '17 at 14:12
Leo Natan
51.5k8123173
51.5k8123173
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
add a comment |
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
Thank you for your answer. but I access currentUserNotificationSettings on main thread and so, my application freeze by it. Strange to say, this issue also happens on [[UIApplication sharedApplication] registerUserNotificationSettings:] method after getting push notification... :(
– Y.Okano
Jan 2 '17 at 14:34
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
What do you see in the stack trace? When app is stuck, pause in the debugger and add a screenshot of what can be seen there.
– Leo Natan
Jan 2 '17 at 14:35
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
Here's mine: link. The app got frozen on this line after receiving a notification, although it IS a main thread for sure. Do you have any ideas?
– demon9733
Dec 8 '17 at 12:34
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
@demon9733 You need to open the stack trace to include the system frames, otherwise it's impossible to know what is going on.
– Leo Natan
Dec 8 '17 at 19:25
add a comment |
up vote
0
down vote
I have just solved same problem on iOS 11.2.6. I provide my system callstak when the app is stuck.
In my case, currentUserNotificationSettings called synchronously on main thread, not asynchronously. So that maybe causes deadlock.
I don't know why this is not occurred in iOS 12. But I hope this can help you. Thanks.
add a comment |
up vote
0
down vote
I have just solved same problem on iOS 11.2.6. I provide my system callstak when the app is stuck.
In my case, currentUserNotificationSettings called synchronously on main thread, not asynchronously. So that maybe causes deadlock.
I don't know why this is not occurred in iOS 12. But I hope this can help you. Thanks.
add a comment |
up vote
0
down vote
up vote
0
down vote
I have just solved same problem on iOS 11.2.6. I provide my system callstak when the app is stuck.
In my case, currentUserNotificationSettings called synchronously on main thread, not asynchronously. So that maybe causes deadlock.
I don't know why this is not occurred in iOS 12. But I hope this can help you. Thanks.
I have just solved same problem on iOS 11.2.6. I provide my system callstak when the app is stuck.
In my case, currentUserNotificationSettings called synchronously on main thread, not asynchronously. So that maybe causes deadlock.
I don't know why this is not occurred in iOS 12. But I hope this can help you. Thanks.
edited Nov 21 at 6:15
answered Nov 21 at 5:44
Samuel Kim
63
63
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41428378%2fios10-i-cannot-get-currentusernotificationsettings-after-getting-push-notificat%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you getting some Exception when iOS decode the payload in push notification?
– orafaelreis
Mar 27 '17 at 17:18