FBSDK share kit iOS9 issue between device and simulator - facebook

I've upgraded FBSDK in my app to the recent version to support iOS9 and included all the LSApplicationQueriesSchemes schemes and NSAppTransportSecurity. Everything works fine including login and sharing.
But when I try to perform a share, the device brings up a sharing dialog, which is a SLComposeView whereas the simulator pops up the safari from the bottom to show a native facebook dialog. I am really not sure whats causing this difference in the share dialog. Is there something i am missing. Login dialog works fine as expected (Safari popup in both simulator and device). I'm attaching pics for understanding.

Answering my own question.
I fixed the problem by subclassing the native FBSDKShareButton. Now the behavior looks fine.

Related

"Safari cannot open the page because the address is invalid" for Google Maps link

I have an iPhone 4s with iOS7 that doesn't have the Google Maps app installed on it. Whenever I try to navigate to a location link on it, it flashes an error at me that says:
Cannot Open Page
Safari cannot open the page because the address is invalid
But then the error goes away (without having to hit OK) and the map shows up, and all subsequent Google Maps links load without this error. When I clear my cache, the error shows up again, but only for the first time, and again disappears on its own.
This is the link in question that I am using, but I have tested it with multiple links and the problem seems to be persistent:
https://www.google.com/maps/place/Kraftwork/#39.971494,-75.127336,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x6db3f86eca2f8b45?hl=en
Any idea what's causing this problem?
To be specific, this problem exists as a result of straight html and just attempting to click a maps link.
I treid to paste to link in the Safari directly and do it programmatically in both iOS 7 and iOS 8 with iPhone 4s, both work for me. Maybe you can try it with iOS 8 simulator with your XCode too.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"https://www.google.com/maps/place/Kraftwork/#39.971494,-75.127336,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x6db3f86eca2f8b45?hl=en"]];

Why can't I use the Javascript Log console properly with iOS 7?

I desperately need to use the Safari console on iOS 7 to debug a site. I've hooked my iPhone (5) displaying the site to my Mac. I've started Safari (v6.0.5), gone to the Develop menu, and started the web inspector for the site I'm on. I can see the list of elements on the site, which confirms I'm inside the correct inspector.
From what I've read, the logs to the console should be displayed inside the Logs section, and from what I've found inside Apple's iOS Safari documentation, I should be able to view logs inside there. For me though, nothing is ever logged. I can't even access any variables or functions; when I type anything in (e.g. document.title), it just 'logs' exactly what I've written, with the text I've just typed still in the input field. However, typing something that causes the browser on the device to show life works (e.g. alert('hi'); displays the alert dialog box on the device).
Can anyone help? This issue we have is only happening on iOS, and there's barely any other way to find what's going wrong. Is this problem limited to iOS 7?
I can confirm that this is an iOS 7 issue. The console.log statement works fine when using an iOS 6 or below device, but with iOS 7 won't show at all :(
Apple == new Microsoft();
Only minutes after posting this I got logging to work again, not sure if this is required, but it seemed to do magic for me:
Connect iOS 7 device
Open XCode
Setup device for development
Connect using Safari
Presto, I can see log messages again?!? (Mind you, I had not made any code-changes)
I had the same problem, just after updating to iOS 7. The solution was to update safari to the latest version for developers, which is version 6.1.

iTunes app link cannot open page in safari in simulator and also iDevices

I hope this may be duplicate question. But none of the answers didn't hard help me. I am trying to open a link from my iOS application. When I press the button, It opens the safari app and it always says an alert "Safari cannot open the page because the address is invalid". Here it is a link looks like the same https://itunes.apple.com/gb/app/app_name/id(appId) .
I don't think it is a good place to post the exact the app link. So the above link is dummy link exactly look like mine. Why the error always happening when I try to open the link. I tried in simulator and also in iPod. Same error occurs. If I try the same link with Safari in MAC OS then it works.
Here it is a code I am using to open the safari from my app with a link.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"https://itunes.apple.com/gb/app/app_name/id(appId)"]];
I am from India. The above link contains gb. Is that link can only open from Great Britain??
UPDATE:
I have good working network. And I tried one more thing. I opened my safari app in simulator and search my app in google and clicking that link shows the same error. Is that a problem with that link in apple side itself??
Kjuly's answer is 90% correct (and +1 to Kjuly!).
If you look at the at the Appirater code,
and in the .m file that has the function that opens up the app store (it's the "rateApp:" method) I see this bit of code:
+ (void)rateApp {
#if TARGET_IPHONE_SIMULATOR
NSLog(#"APPIRATER NOTE: iTunes App Store is not supported on the iOS simulator. Unable to open App Store page.");
#else
So no matter what you try, you are not going to be able to open the App Store app within the simulator. The App Store app does not exist in the simulator, so that's why you get a "not found" error when your web view attempts to redirect to it. This should work fine on the actual device that has the App Store app installed.
Take a try with this URL:
http://itunes.apple.com/app/<appId>
Note: Replace <appId> with your desire App's ID, e.g. id543028543.
That is a possibility as you are specifying the region to which the app belongs or is hosted on the app store under. Try loading the the url without the region 'gb'.
I was having same problem. Links in email not opening, links to App Store not working and App Store not searching or loading apps. I called Appke support. A reset worked! Go to settings to find how the reset under general. It doesn't delete anything either.

iOS Hiding Elements on Screenshot

I've extensively searched the web, and everything I've found suggests that I can use 'applicationDidEnterBackground' to detect that a screenshot is about to be taken, hide the relevant controls, and then show them again in 'applicationWillEnterForeground'.
Circumvent screenshot for iOS 4
Unfortunately, I can't seem to get this message to be sent to my app when I take a screenshot on the device. I've even created a brand new template app, and tried that, and they are still not sent.
The only thing I can think of is that I'm running iOS 5.0.1 on my device, and all of the web pages I've found have referred to iOS 4.
Can anyone verify they have it working on iOS 5, and if so, what do I need to do to get it working in my app?
Please help.
The srceenshot talked about in the thread you mentioned is the one used when app is send to the background when the user presses the home button.
It is the screen that the user will see when you start the app when it is already running.
You arre talking about the screenshot when the user is pressing the home and power button are pressed at the same time.
The screenshot with this methods (home + power button) can't be detected by my knowledge.

How do I link to another app in the App Store in an iPhone app?

I used this technique, but it appears to not work anymore in 3.0. In the simulator at least, my app opens Safari, and then there is a visible redirect, but then I get a message that there has been too many redirects. Any fix?
Have you tried this on the device? There is no App Store application on the Simulator, so any attempts to redirect to it will fail.
Within my application, the itunes.apple.com links for the App Store work just fine under 3.0 on the actual devices.
I can't test this right now, but have you tried changing the 'http:' protocol in the link to 'itms:' instead?