I'm having the same problem -I'm calling requestAuthorization at the containing app, and the user approves notifications.Then at the Extension, I'm calling getNotificationSettings, but the authorizationStatus is notDetermined, and the error is "Notifications are not allowed for this application". Trying to post notifications from the containing app is working fine, but I want to send the notifications from the extension, because the app might be in background mode.Also, looking at the Mac's Notifications Settings, I see that the "Allow Notifications from myApp" is enabled.I tried to test it on several devices - iphone with iOS 13, Mac with macOS 10.14.5 and Mac with macOS 10.15.2.
Post
Replies
Boosts
Views
Activity
Got it, thanks!
I'm using HTTP so simulate detection of a captive-portal, so there are cases I must use HTTP.I'll use the exception for the Extension only.Thanks!
Got it. Thanks!
"Are are you talking about screen lock, that is, the device is awake but the screen is locked / off?" - in this case I think the notification should be shown, doesn't it? Isn't this the default behavior?And as for "device is truly asleep, your code is not running" - when the device is aleep, nothing runs even within the Packet Tunnel Provider? I thought the device do create some traffic even when on sleep mode, to check mails etc..
If it will reproduce I'll collect all the info and open a bug.Thanks!
Update:Upgrading the OS to 10.15.2 (from 10.15.1) solved this issue. But any idea what caused it? Can it happen on users' Macs which run the app from the App Store (and not from Xcode as I did)?
Very old thread, but did you manage to disply the portal page when you are using VPN with Packet Tunnel Provider, and entering a place with a captive portal WIFI?
K, I'll do it and report if I'll find something interesting.Thanks again!
1. "Adding a exit(0) will terminate your program and I would bet this is not the desired action in this case." - this is not accurate. I'll add the exit(0) only where the user asked to stop the tunnel, so instead of a "clean exit" from the extension, I'll just terminate it.I read here at the forums that this is already acceptible behavior (because of the (knwon) bug that if you are trying to connect shortly after a disconnection, the connection will succeed, but you will get a disconnection after 20 sec).So I'm guessing that using this approch is considered ok, but please correct me if it may cause harm in some way.2. By " capture the incoming "Network is unreachable" error and programmatically force a disconnect on the VPN and then a new connect", you mean something like calling cancelTunnelWithError?3. Thanks for the quick replies!
Thanks, I'll try to capture this error and search for more helpful logs.But if it's really something like "VPN connection is still being cached somehow, possibly an interface that no longer exists" - if I'll add exit(0) at all the "correct" places (where the extension should stop), will it help?
Thanks. I'm not doing any pre-flight checks for determining the status of the network to setup the VPN tunnel, and regarding the NEOnDemandRuleConnect - I defined a rule to always connect (this is the closest thing to always on). I do have logs at the server, but it seems the client isn't sending any requests. So it's a client issue.However, one of my users described something more specific, and he says it's persistent:He was at the office, connected to the LAN, and the VPN was off.Then he left the office, and walk home. The Mac entered sleep mode.At his home, he opened the Mac and connected to his WIFI. Then he tried to turn on the VPN.The VPN was stuck at 'connecting' phase. He needed to press the disconnect button, and then try reconnecting again. Only then it succeeds.From the logs I saw that when he first clicked the connect button, the error "network is unreachable" appeared.When he pressed the connect button the second time, everything was fine.So I think this is the situation:The VPN protocolConfiguration disconnectOnSleep is set. So when the Mac enters sleep mode, the system calls stopTunnelWithReason. When the Mac awakes, because my OnDemandRules, the OS would start the PacketTunnelProvider again.However, it seems that sometimes in those cases, the network would be unreachable.If I'm right, how can I solve it? And how can I print when the Mac enters sleep mode?
K, I'll check if it's possible for me to do those changes. Thanks!