Embed youtube in ios 9 - xcode

I've embeded youtube videos in ios 8 many times using the following code (I intentionally replace the video code with ----). After upgrading to ios 9, the video no longer plays (go to a YouTube Help page title "Video player error message".
Does anyone know what changed in ios 9 and how to fix this?
NSString *EmbedCode = #"<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/-------\" frameborder=\"0\" allowfullscreen></iframe>";
[[self webviewer] loadHTMLString:EmbedCode baseURL:nil];

In iOS9 it is important to switch everything to HTTPS.
So I'm facing the same problems like you. Some videos are playing, some videos are not playing.
See Apple’s App Transport Security Technote for full details
(Source: WWDC 2015 session 703, “Privacy and Your App”, 30:18)
You can also ignore all app transport security restrictions with a single key:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
With adding the key everything works. But I think this is only a temporary solution. You don't know when apple starts rejecting this.
I also filed an issue at Google.

Had the same issue, but in the last few days, it has started to work on iOS 9 with no security exemptions. I think Google got their servers up to the required security levels.

Related

App Center In-App Update Stuck in a loop iOS

I have a Xamarin iOS app that I am trying to distribute in the App Center. It will send out an email and install fine, but when you run it, you get the error
MyApp.iOS Wants to use "appcenter.ms" to sign in.
I have the option of cancelling or continuing. I hit continue and it signs in and says In-App Updates are enabled. It then returns to my app with the message:
In-App updates disabled.
This release was either side-loaded or downloaded using a browser in private mode.
I can either Ignore or Reinstall app. Ignore lets the app work, but it no longer checks for updates. If I Reinstall app, it opens App Center and I can install it, then it starts back at the beginning. It is using Safari to do the original install. I assume that when it does the Reinstall app from within my app, it is using a Safari based browser. Nothing is in private mode as far as I can tell. My startup code for App Center is
Distribute.UpdateTrack = UpdateTrack.Private;
Distribute.DisableAutomaticCheckForUpdate();
AppCenter.Start("11111111-2222-3333-4444-555555555555",
typeof(Analytics), typeof(Crashes), typeof(Distribute));
In my main view, I have the code
public override void ViewDidLoad()
{
base.ViewDidLoad();
Distribute.CheckForUpdate();
}
In my Info.plist I have
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>appcenter-11111111-2222-3333-4444-555555555555</string>
</array>
</dict>
</array>
Cookies are not disabled that I can tell. I have searched high and low and can't find anything like this. The only similar issue seemed to be someone messed up the Info.plist. Can anyone help?
OK, I finally figured this out. When I was testing the distribution of my app from the App Center, rather than spam the whole group until it worked, I just distributed it to myself. This is what caused the problem. What I had to do was to create another distribution group and only have myself in it. Automatic updates started working once I did this. The point being is that if you don't distribute it to a group, then it thinks it's side-loaded.

Safari app extension: contentBlocker(withIdentifier:blockedResourcesWith:on:), how does it work? how to get it to work?

I am trying to save an extension that Apple is killing with their move to safari app extensions.
I am running OSX beta 10.15 and the latest Xcode beta.
There is a new API contentBlocker(withIdentifier:blockedResourcesWith:on:)
But as with other related updates in this space the documentation is lacking.
Is there anyone out there that knows how to get that to function?
Or is able to point me in the right direction?
Specifically, how does this work and how to get it to work?
Do I need to implement my own content blocker?
If so, then how does the communication between the content blocker and the safari app extension work / what needs to be configured to make that communication work?
Would be nice to have this tested before 10.15 actually goes live...
You'll need to first create a new target in the project for your Content Blocker. Then, in the info.plist for your Safari extension, under the NSExtension dictionary, add:
<key>SFSafariAssociatedContentBlockers</key>
<array>
<string>BUNDLE ID FOR YOUR CONTENT BLOCKER</string>
</array>
You can then add the contentBlocker() method to your SafariExtensionHandler class.

Open Facebook Post in Facebook App From iPhone App

If I have the id of a Facebook post, how can I open it in the native Facebook app? I am able to open links using [UIApplication sharedApplication] but I cannot come up with the correct URL scheme. For instance, fb://profile/pidhere works to open the profile but I can't figure out how to open an individual post. Thanks a bunch!
It's been asked many times here. And the answer is: it's not possible.
There are methods to do this on Android, but that is not officially supported. You should not rely on it. This is the same for iOS. Some links work, but they are unsupported, can change any time and for some items, such as posts, it's not possible at all.

Bug with sharing via SLComposerSheet

So i use SLComposerSheet in my project for share text and image into Facebook. Today 27 April after update facebook application i have interesting problem, method setInitialText doesn't work!. I determined that if i deleted fecebook app from iPhone, method setInitialText works perfectly! Maybe someone know how to fix this bug? Or we must to wait update for Xcode?

Including info.plist (iOS) when exporting to Air native extensions

I am having problems with exporting a working .ANE using the external accessory framework of Xcode/iOS. Let me briefly show what I did:
I took the Vibration example of the adobe website, I can successfully edit this example and create a .ANE which works on my iPad and force it to make a sound (vibration is not supported on iPad obviously). I then included elements of the framework that I developed, for a specific form of bluetooth communication with an external device.
This device can communicate to my iPad using the ExternalAccessory framework. It works great when I build an application in Xcode only. The problem is that people within my organisation are not used to work with objective-C so they asked me to make it compatible with AIR. Which I am extremely close to. Actually all my classes' logic seem to work and the different methods are called effectively. There is one problem though:
In order to make the External Accessory framework work I need to include the protocol of the external device in my plist. And the library example provided in the Vibration example does not seem to contain an info.plist so I do not know how to include the protocol in this library.
Can anybody help me? Maybe with specific experience in this direction, or by explaining to me how to create an info.plist file for my library. I think this is the only brick I need to complete my challenge.
FYI: I found out that the problem is in the protocol by debugging using the console of the Xcode Organiser, this is the error I get: ": ERROR - opening session failed as protocol [I deleted the protocol name for my organisation's sake] is not declared in Info.plist"
I managed to solve the problem, the trick is to edit the xml file that is generated along with your app. This should be entered into the code:
<iPhone>
<InfoAdditions>
<![CDATA[
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string> ... </string>
</array>
]]>
</InfoAdditions>
<requestedDisplayResolution>standard</requestedDisplayResolution>
</iPhone>
Then it will work correctly. (for ... enter your protocol)

Resources