Enable the Multicast Entitlement from Xcode IOS - ios

Suddenly My printers stop discovering the app on iOS16, I discovered Multicast need to activate inside AppID and enable through Xcode it will start working fine.
Eventually, I submitted a form for Multicast on the app store and got approved, I enable it from my apple account: Identifier -> Additional Capabilities -> Mark multicast and save it
Next, have researched and found .entitlements file, add a com.apple.developer.networking.multicast entry with a Boolean value of true
But in my app there is no such file called .entitlements where I can add com.apple.developer.networking.multicast.
Noted: I have updated plist with bonjour services and added Privacy: local network notification, I also not found multicast in +capabilities from the target of Xcode
Is there a need for something certificate or what?
Aprpreciated
Any video or snap where I can enable multicast from Xcode

Related

Associated Domains with `applinks:` is not working in development

I'm trying to set up Associated Domains in my unpublished app for iOS 14. I followed the documentation as good as possible. I'm testing locally with my local dev web server and the app itself in simulator and a real iPhone.
Not only are links not opening in my app, the app does not even attempt to request the file https://mycomputer.local/.well-known/apple-app-site-association from my local web server (I let the web server print a debug message whenever it is requested, but the message is only printed when I manually load it from a web browser).
This is a list of things I have done/checked:
Xcode 12.2:
Under Signing & Capabilities added Associated Domains
Added to Domains: applinks:mycomputer.local?mode=developer (I also tried IP address)
I disabled Automatically manage signing and instead created a Profile on https://developer.apple.com/account/resources/profiles/list (type Development, platform iOS, it has Associated Domains amongst other enabled capabilities and it's linked to my app bundle ID) and selected that profile for the debug build.
I made sure that the URL https://mycomputer.local/.well-known/apple-app-site-association is accessible from all devices involved, i.e. my computer, Safari in simulator, Safari on real iPhone (all are connected to the local network and successfully display my JSON file).
Screenshot:
As mentioned above, I can pretty much rule out that the problem lies with the JSON file itself as I can proof that the device is not even accessing it. Am I missing something or misunderstanding the concept?
My own answer: Using the query string ?mode=developer in the entitlement as described in the documentation simply appears not to work at all.
To verify this I have set up a real server that can be publicly reached on the internet and tried both variants:
applinks:example.com
applinks:example.com?mode=developer
Number 1 works, but the JSON is loaded via Apple's CDN and you cannot use it for local development or for quickly testing different versions of the JSON file as Apple will cache the file for probably one day.
Number 2 does not work at all, no request to the server will be made.
Also, good to know these requirements when testing on actual devices. (And using a domain thats not publicly available in testing period.)
Turn on Developer Mode on the device.
Turn on Associated Domains Development in the Developer settings. (Developer settings will first occur after you have turned on Developer Mode).
Build the app using developer certificate. (Enterprise will not work).
Add ?mode=developer to the domain in entitlements if you are testing with a domain thats not publicly available (Behind VPN..)

iOS Broadcast Extension(Screen Broadcasting) is not Working

I'm new to Programming Business and making Broadcasting App Which is supposed to Handle Screen Broadcast Function(iPhone Control Center --> Broadcast. Like a Mobcrush).
So I try to implement Broadcast App Extension that was introduced at WWDC, but my Demo App Doesn't work well. My Demo App Just Doesn't Broadcast And Just Show Me an Error Alert Which Says "Live Broadcast to MYDemoApp has stopped due to: (null)"
Here Are The Things What I Did On Demo App
Implementing App Extension(BroadCast Extension. Which Makes SampleHandler, BroadcastSetupViewController)
Implementing App Group(Setting Capability, BundleIdentifier,
Setting App Groups And Provisioning Profile in Developer.Apple.com)
Pod Install And Copied The Codes That I Didn't Write From Other Developer's Demo App (HaishinKit)
(https://github.com/shogo4405/HaishinKit.swift)
Put RTMP URL String in userDidFinishSetup() in BroadcastSetupViewController
(This App is Demo, So i Just Put My Own RTMP Address And Stream Key. Like This : rtmp://bc.CompanyName.tv/app/VeryLongStreamKey)
Plus, I Think this is Not an RTMP URL Issue. because I already did Camera(Front, Rear) Broadcast Test With That URL(Not an App Extension. Just in the Simple ViewController).
Could you Tell Me A Hint? Any Feedback Would Be Appreciated!
Thank For You Reading My First Question About Coding.
This is an Alert That I Saw
I found there is many limitations on iOS broadcast extension.
- If extension started by container app via API, Network become off when app goes background.
- File access is not possible.
- Asset access is not possible.
- Swift print() do nothing. Use NSLog() and idevicesyslog.
- Xcode "Attach to process by PID or Name..." works.
If you get "due to (null)" error, debug on Xcode by attaching process.
Or put NSLog() and see by idevicesyslog.

iCloud synchronization on tvOS

has anybody managed to get iCloud working on tvOS so far?
I am using key-value-storage and it successfully saves everything in iCloud. However, it does not synchronize the data between the iOS-App and the tvOS-App. I am using the same bundle-identifier for both apps.
Has anyone experienced the same issue?
So, it appears that Apple may have an issue here on the tvOS side, because if I follow Apple's instructions on Configuring Common Key-Value Storage for Multiple Apps I can share between and iOS App and a macOS App, but not the tvOS app using exactly the same setup.
Below are my results:
Apple's Instuctions that I used 1st:
So, CloudKit is all about the default Container rather than the App bundle ID directly. So, I setup my Primary iOS app with default container that will become the key-value share container.
Here is my Primary Entitlements file:
I then stored two NSUbiquitousKeyValueStore pairs in the default store and retrieved the values:
NSUbiquitousKeyValueStore.defaultStore().dictionaryRepresentation
So, in my macOS app I enable CloudKit as well, and remove the default container and set it to the Primary iOS apps container. Then in the Entitlements file I manually setup the com.apple.developer.ubiquity-kvstore-identifier to include the Primary App's bundle ID:
Uncheck default container and toggle Primaries:
Here is my Secondary macOS Entitlements file:
Then I run the macOS app and presto, I have the key-value pairs from the primaries default key-value store and retrieved the values easy-peasy:
NSUbiquitousKeyValueStore.defaultStore().dictionaryRepresentation
If I then make the SAME EXACT MODIFICATIONS to my tvOS app, the defaultStore() show as empty and I cannot get it to share with the iOS and macOS app.
Here is my Secondary tsOS Entitlements file:
And no presto, no values:

What is this error 7 with google-cast sample ios/application?

I downloaded the chromecast ios sample and when I connect the sample application to chromecast, it give the following error:
error domain=com.google.GCKError code=7 "The operation couldn't be completed. (com.google.GCKError error 7.)"
Do you know why?
I got the same error message while testing the "CastHelloText-ios" sample provided by Google on GitHub.
First I checked all the required steps described by Google were ok:
In your cast developer console: check your Chromecast has the status "Ready for Testing" otherwise register it.
host the receiver somewhere on the web and note the URL
in the cast developer console, declare a new app with a custom receiver and fill the URL of your receiver. Save it and note the application ID.
fill this application ID in the controller of your iOS app: static NSString *const kReceiverAppID = #"1234ABCD";
make sure that your chromecast has the option "Send this Chromecast's serial number to Google when checking for updates" is ticked (in the iOS app it's in the General section of your device)
Finally I solved the issue by rebooting the chromecast:
Run the Chromecast iOS app from Google, click on your chromecast device, click on General and click on the red button "Reboot".
For information, I've performed this reboot after reading the note of this Google documentation:
If you wish to verify that your published application is working properly, you can manually restart your Google Cast device to force a load of new configuration data.
PS:
- to reboot your chromecast you can use any chromecast app provided by Google (iOS, Android, MAC, etc.)
GCKErrorCodeApplicationNotFound - Typically this error will occur if either your device doesn't have [x] send my serial # to Google set, or your AppID is incorrect.
We'll try to get the docs updated shortly.
For test this app you will need to change this line
[self.deviceManager launchApplication:kReceiverAppID];
To use default applicationID:
[self.deviceManager launchApplication:kGCKMediaDefaultReceiverApplicationID];
Or you need to create a development account and to change kReceiverAppID with your AppID.
And if you have an another error, you can to check the GCKError.h class, there has all error codes possible with explanation
I had the same problem. In my case seems like the Chromecast still associated with the old Application ID. It worked fine after restarting the device.

Common iCloud container between Mac and iOS app?

I want to build an iCloud based app that runs on both the Apple platforms, iOS and Mac. The app will use UIDocument on iOS and NSDocument on Mac to have a document based synchronization model - documents created on iOS will be available on Mac and vice versa.
The particular problem I'm facing is that I want the same iCloud container on both the apps. XCode creates a default container for the app based on the App ID, which has to be different on both the apps because this seems to be an Apple requirement - no two apps can have the same app id even if they are on different platforms.
So I left the default created container alone and added another container on both the Mac app as well as the iOS app. The app seems to work fine, I can create a new file package in both the apps in the correct place, but I'm having 2 issues:
The container does not appear properly in the iCloud settings management screen. In the entitlements section in XCode, I named the container as com.mycompany.myapp.mycontainer in both the apps. In the settings screen in iOS (Settings -> General -> Usage -> Manage Storage -> Show All) my app is listed as "mycontainer" instead of the App's actual name as I expected. Is it possible to supply a name and icon in the App's Info.plist to make it list properly?
My NSMetadataQuery is not working properly. I had made the iOS app with the Empty Application template, so the Info.plist was not properly setup with the CFBundleDocumentTypes key but I figured that out and fixed it. For firing my NSMetadataQuery in the iOS app, I'm using:
[self.queryCloud setPredicate:[NSPredicate predicateWithFormat:#"%K like '*.myextension*'",NSMetadataItemFSNameKey]];
with the search scope set like this:
[self.queryCloud setSearchScopes:[NSArray arrayWithObjects:NSMetadataQueryUbiquitousDocumentsScope, NSMetadataQueryUbiquitousDataScope, nil]];
I run the query after establishing the container's URL, I get the started and finished gathering notifications, but never the update notification from the NSMetadataQuery. Unless I go ahead and create a new document. If I create the document then I get notifications for Update, but only in that session. Next time I start up the app, the same settings don't give me any update notifications from NSMetadataQuery.
What am I doing wrong? Any pointers to articles on creating an iCloud document app targeting both Mac and iOS would be much appreciated! Suggestions, thoughts are most welcome.
I don't know about your NSMetadataQuery issues, but adding a shared iCloud container is easy, as long as you get the gotcha:
Pick one app ID that will be your shared cloud container. Doesn't matter if iOS or Mac OS X, you need to publish this app and it must be approved from the Apple Review Team* before your iCloud container will be available to any other app. e.g.
com.company.myawesomeapp
Note that you must not use a container name after your app ID (com.company.myawesomeapp.cloudcontainer), just use your appID!
Pick a second app ID (doesn't really matter), and create your second app. Open up Xcode and enable iCloud in the Capabilites Pane. Then under "iCloud Container Identifiers", add the identifier of your first (published and approved!) app
com.company.myawesomeapp
That's it!
There's just this one catch and that's the bottom line:
In order to use a container, an app must be available and approved. Before approval no other app may access your container, because technically it only exists as soon as your app is approved. Actually, it doesn't have to be available in the AppStore, it just needs to be approved (can be on developer held release).
You can only use a (shared) iCloud container if your app is published and has been approved.

Resources