enabledRemoteNotificationTypes returns wrong value on ios 6.0.1 ipod - ios6

We are checking to see if APNs are enabled by using the UIApplication's enabledRemoteNotificationTypes method. This works fine for iPhones with iOS 6 and below. However, on an iPod with iOS 6.0.1, the method continues returning 0, indicating that no APN types are enabled, even when APNs have been manually enabled in the iPod's settings.
This occurs after APNs are first manually disabled on the device for this app.
Has anyone else seen this? And do you have any advice as to how to deal with it?
Thanks.

Related

Can't load expo app: Something went wrong

I've created an expo app with exp init MyApp command and started it by running exp start in MyApp directory.
Then I'm scanning barcode which was printed in console with expo mobile app on android device.
Then "Something went wrong" screen is rendered instead of the app.
View log shows "Uncaught Error: Couldn't load exp://.....".
No errors in expo packager console output.
It used to work sometimes ago.
What solved this for me was simply changing the connection from LAN to Tunnel. When you start an expo app, a browser window will open with a URL like http://localhost:19002/.
Along the left side is a Connection option set to LAN by default. Changing it to Tunnel before scanning the QR code with the expo app solved it.
For me the problem was happening when running over WiFi, as the tools always use the your first connection (you can check it by running ipconfig) and my first connection was internet.
If that's you case you may try this workaround for changing you connections priority:
Go to Control Panel > Network and Internet > Network Connections
Right click the desired connection (Higher Priority Connection)
Click Properties > Internet Protocol Version 4
Click Properties > Advanced
Uncheck 'Automatic Metric'
Enter 10 in 'Interface Metric'
Click OK
In my case, the issue was fixed by doing the following on my Android (Galaxy Note 5):
Go to Settings > Apps > Application Manager > Expo
Scroll down to Draw over other apps and toggle it off and then on again
Close out of everything, re-open expo, and try connecting
It still threw an issue once before working perfectly upon further tries.
For my case, using wireless adapter, I had to make my Network profile private.
1) Go to Properties of wireless network
2) Make network profile private
It was needed to reset "Draw over other apps" permission for Expo mobile app.
How that is fixed on Android 6.
Settings->Apps, press "gear", find "Draw over other apps" item and select it. Find "Expo" app, select it. Enable "Permit drawing over other apps" option in case it is disabled. Otherwise, disable and enable it again.
Make sure that you are using the same wireless network for iOS or Android phone as your computer.
In my case, I had "host" set to 'localhost' in the XDE - which of course won't work on my physical device ;-) So, if you want to debug on a physical device, make sure your host is set to LAN instead. (Tunnel would work too, but would make debugging painstakingly slow)
For me its worked by selecting the tunnel connection rather than LAN in metrol Bundler..
Try it out....
In my case, expo app was outdated. I just updated expo from store and it started working.
In my case, it works when I changed connection LAN to Local.
but it requires to connect phone through the data cable.
If you have a similar issue but the error says 'Uncought Error: java.lang.Exception: No launchable update', make sure you remove the "runtimeVersion" from your app.json while developing. Strangely enough, having "runtimeVersion" present works on iOS but it will fail to run on Android Expo Go app.
I had the same problem and I solved it by deactivating the Virtualbox internet connection, that happens because Node take that connection to start the packager.
Control Panel -> Network and Internet -> Network Connections
In my case is "Virtual Box Host-Only Network"
Right clic on that, and Deactivate
For anyone that using ESET firewall, you have to go into firewall rules and allow ports 19000,19001,19002, Advanced->Rules->Edit, on General tab select Direction->Both, Action->Allow, then visit Local tab and on port field add the mentioned ports above, click ok. Do this action for every port you need to add.
In my case, the problem was not with the firewall the problem was with my internet I was running my computer and phone on two different internets then I connected my phone to the router which is connected to my computer and again I tried it worked
I had the same problem and fixed it on Windows 10 by making my machine discoverable on the network:
Click wifi icon in app drawer.
Go to the list of wifi connections and click your connection.
Click "Properties". This opens up the page associated with your connection.
Under "Make this PC discoverable", turn the slider to "On".
For macOS users and if you are running over Wi-Fi:
Choose Apple menu > System Preferences, then click Network
Click Wi-Fi in the list at the left, then click Advanced
Find the network you are connected to
Then drag it to the top of the preferred networks list to give highest priority
This procedure solved my problem.
For me, expo wasn't started. So expo start in VS Code terminal solved it.
It depends on what OS are you using. If it is Windows 8 or earlier, try updating the version. In Windows 10 and Windows 11 it should work correctly. Try installing expo globally instead of local install.
You should also install expo in the project root directory after project setup:
npm i expo // or npm i -g expo for global installation
If you are using yarn, then try npm as well.
According to me, what have solved my issue were a few things below:
Restart Expo and then try scanning the barcode once again.
You can also reload the application by clicking R on Code editor. And the caption "Something went Wrong" will reload.
You can check the internet of your mobile device and the laptop/desktop is connected with same network.
Restarting the project sometimes also helped me. As the file does not compile properly it sometime create this issue.
Hope this you will your issue resolved soon.
I believe this issue is happening due to mismatch version of your AVD and your expo mobile application. I created new AVD with newer version of Nexus 6 API and issue was resolved. I also needed to reset "Draw over other apps" permission for Expo mobile app.
For me, I have to close and kill expo (from RAM) AND close the QR Code overlay view to get it work on Android 5.1.1.
Sometimes I have to wait a few minutes or I get a camera view and a text above about scanning the QR Code (but without a scanner over the camera view).
If you're not able to load the http URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager. If you are using a VPN you may need to disable it.
I solved it by deactivating it, although you could also open port 19000, which is used by Expo.
Uninstalling and reinstalling expo on my Mac cleared this for me. Expo was complaining about being out of date.
Do some things.
ForceStop App.
Restart App.
Clean Cache and Clear Data.
Else due to outdated expo. Update expo from play store.
Note: Expo no longer available for IOS physical devices.
Let me know if any issue occurred!
In my case was that the phone was connected to a VPN (CyberGhost) and it showed up only a white screen D:
In my case, windows firewall was blocking it. So, I made it run by turning the firewall off.
I think that the solution for this might be the most simplest thing. What works for me when the app doesn't load on the emulator using expo is just clicking X and closing the info alert that pops up. You'll see the following Info Alert and if you close that out and try hitting the running on Android button again, then it should work. Otherwise deleting and creating a new virtual device also helps incase the cache or expo installation on the device is really causing problems.
That issue was solved very easily following these steps:
Sign in with the expo mobile app using your expo account.
When we run the app using the expo start command can see the localhost web page, In that web page left side can see Connection, by default it is Land,
change it to the Tunnel.
Scan the QR code.
Local connection works for me.
prerequisite :
Add the adb.exe path to environment variables.
(In my case : D:\AppDevTools\Android\Sdk\platform-tools)
Connect your android mobile phone to your pc using a USB cable.
Enable USB debugging on your mobile phone.

Can't login into the CocoonJS Developer app

I want to log in into the CocoonJS Developer app (on iOS, iPad mini), but I got an error "CSRF protection". I aso tried "Connect with Google", but that isn't working either because of cookie settings or something.
What am I doing wrong?
Note: I also tried it on my iPhone 4S, but also without success.
I had the same thing, but now it just says unknown error. Maybe it doesnt like jailbroken iphones/ipads
another possibility (and the cause of my issue) is you're using the old cacoonjs app on your ipad mini. It's confusing because they left links to get that app on the appstore on their old website which is still online here: https://www.ludei.com/cocoonjs/
You have to now go to cacoon.io and follow instructions, the old services are no longer running. https://cocoon.io/

Can't debug a local app engine PHP app with PHPStorm and Xdebug

I'm on a Mac and I've installed the latest version of the App Engine PHP SDK (1.9.19 - 2015-04-13) which include support for XDebug (since 1.9.18).
I'm using the latest version of PHPStorm (8.0.3) with the GAE plugin.
I've no trouble to run my app through PHPStorm but I can't get the debugger working automatically (will explain what it means few lines below).
Each time I try to debug my app, the debugger pane stays saying "Waiting for incoming connection with ide key '11634' " (the ide key is always a random number).
No breakpoints are triggered, and when I stop the execution, a little red popup displays: "debug connection with xdebug was not established"...
I've tried what the Google documentation suggests and it didn't work either.
Finally after hours of trying almost anything (compiling my own version of XDebug, checking every conf file, overriding php.ini to ensure paths to XDebug is correct and XDebug is on, etc...) I found a "workaround"...
The only way I can't get the debugger to work is to launch the app, then go to the debugger pane to know what's the key it's waiting for (let's say "15981"), then go to my web browser and manually add XDEBUG_SESSION_START=15981 as parameter to the URL.
Since the key changed every run, it's really a pain to work like that, and I don't talk about page redirection, etc...
Is anyone having a thought on that?
Thanks
You can start local App Endine server with App Engine For PHP run configuration, just as in JetBrains tutorial.
Then please enable Listen to incoming connections (that phone with small bug on toolbar near run configurations, or in menu Run | Start Listening for PHP Debug Connections). Then reload the page in browser. Debugger should stop on the first breakpoint or on the first line of code if that setting is enabled.
Also feel free to watch or vote the issue on bugtracker.
#leneshka has the answer! I've been pulling my hair out trying to figure out how to get PHPStorm to use the xdebug.idekey value I specified in xdebug.ini.
As soon as I enabled Start Listening for PHP Debug Connections, I was able to start debugging with my personal xdebug.idekey value.

Apple apns push notification i iOS 6

i'm trying to set push notifications for my new app and i have heard that in ios 6 device token changes each time the app is launched !
Is it true ?
Can someone tell me what i've changed to Apns in iOS 6 ?
Thanks a lot for any help. (i've google it do not worry)
That's not true.
Device Token rarely changes (it usually only changes if you change your iOS version or restore your device from a backup).
In fact, all the applications on the same device have the same device token.
And these things haven't changed in iOS6.
Regardless if the device token changes or not, it's best to re-register each time the app is launched to handle the possibility of a change (which CAN happen in some circumstances).
In your application:didFinishLaunchingWithOptions: you should use this code to avoid any problems that may arise due to the device token changing:
UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (types != UIRemoteNotificationTypeNone){
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert];
}

SDK 3.1: How to tell whether SDK is using iOS6 accounts or not?

If I have a Facebook account set up in iOS6 but the user has switched it off, the SDK just gives me a FBSessionStateClosedLoginFailed status. From that, I can't tell if the user has switched us off in iOS (case 1) or doesn't have an account set up in iOS and declined permission from the FB app or web app (case 2).
The error messages I need to present are quite different in the two cases. In the first case, we need to tell the user how to switch us back on, but those instructions would be confusing for someone in case 2.
I tried using the iOS Accounts framework, but if I'm switched off, I'm told there ARE no Facebook accounts even if there are. I also tried writing down the account identifier if I ever successfully authenticate, but accountWithIdentifier fails similarly if we are switched off.
Anybody know of a way to find out if our rejection is coming from iOS or FB itself?
The policy of the SDK in general is that if some operation is in the process of failing, the underlying error information from the OS is bubbled up to the app. (Of course not all failure cases start with an OS API failing.) The reason for this policy is to support more precise error handling and logging scenarios like the one that you describe. As an aside, if you ever find a place in the SDK that does not follow this pattern, it is a bug and please report it.
In this case FBSession is passing an NSError object to your handler, and it sets the FBErrorInnerErrorKey value in the userInfo to the error object returned by the OS. In order to provide a precise error message to your user, you can use a snippet of code like this in your FBSessionStateClosedLoginFailed case:
if (error) {
NSError *innerError = error.userInfo[FBErrorInnerErrorKey];
if ([innerError.domain isEqualToString:ACErrorDomain] &&
innerError.code == ACErrorPermissionDenied) {
NSLog(#"User dissallowed permissions via iOS 6.0 integration");
}
}
Hope this helps!
* UPDATE *
Just tried this on a device and found two bugs; one in iOS 6.0, and the other in the SDK. The iOS 6.0 bug is that when the switch is off, no NSError object is passed by the OS, and so there is no inner error. Thus making the general solution from above not work for the specific case in question. The second bug does provide you a temporary solution to this problem using the SDK 3.1.1.
The bug in the SDK 3.1.1 is that we set error.userInfo[FBErrorLoginFailedReason] to the value of FBErrorLoginFailedReason. In the case where the inner error is NIL, you can check for this reason value to determine that the slider for the app was set to off. When this bug is fixed in the SDK, then the code testing for this will break, however, since we will be setting the reason to a more logical reason related to iOS 6. This is a gotcha to watch out for in a future build of your application, if you decide to rely on this value.
With iOS 6.0 and later, when you access setting device and turn off facebook integration in your app. You can check it by code
//Callback method for facebook authorization
- (void)sessionStateChanged:(FBSession *)session
state:(FBSessionState) state
error:(NSError *)error
{
.....
if (error) {
NSString *valueError = [error.userInfo objectForKey:FBErrorLoginFailedReason];
if ([valueError compare:FBErrorLoginFailedReasonSystemDisallowedWithoutErrorValue] == NSOrderedSame)
NSLog(#"To use your Facebook account with this app, open Settings > Facebook and make sure this app is turned on.");
}
}
If the login fails you could try opening the old webview facebook login dialog which iOS cannot reject. If that succeeds then they don't have iOS 6 or they switched you off in iOS 6 which I didn't know was possible.

Resources