iOS chromecast app connecting but not launching with new framework - ios

Hello I am trying to cast the demo videos for iOS in the github reporitory.
When running CastHelloVideo-ios I see that the program finds the device, conects to the device but it never launches the page. I have the same issue with the other samples in the repository.
The only one that was able to run one time is CastHelloText with Application Id "588BF969". Then I tried to create another application ID "70138F0B" for the same project and it doesn't launch the page, this is the log.
2014-02-06 16:46:20.862 HelloTextGoogleCast[8798:60b] device found!! CVC Off
2014-02-06 16:46:20.866 HelloTextGoogleCast[8798:60b] device found!! JBcast
2014-02-06 16:46:22.873 HelloTextGoogleCast[8798:60b] Selecting device:JBcast
2014-02-06 16:46:24.348 HelloTextGoogleCast[8798:60b] connected!!
NO LOG LAUNCHING THE PAGE
PLEASE HELP, what can I be doing wrong if is the same URL for both Application ID's, from the same application. AND yes, I replace kReceiverAppID for each case!!
Thank you

Have you registered your device for your appId on the developer console? Since the 588BF969 app id works (that is a published app Id, meaning that it is allowed to run on all devices) and your app Id doesn't work, I suspect the issue is in your device registration. Please
(1) Double check the serial number of your device on the developer console to makes sure it matches your device's serial number
(2) Makes sure you have checked the box that sends the serial number to google (this is in the setup application for your chromecast). Also try to connect to http://:9222 from a chrome browser on your network to see if your device is whitelisted
(3) Reboot your chromecast to make sure it has picked up the new configuration.

To answer my own question and reply to previous reply, non of my applications in the developer console are published yet, and the serial number in the device is fine because it work for one but not for the other one. Also the box that sends the serial number to google was checked.
The problem seems to be some cache, and it is very easy to fix:
1) find device IP on the settings app and got to chrome browser, enter Device IP plus port 9222, and you would see a white page that says "Chromecast Home Screen"
2)Click on "Chromecast Home Screen" and you will see another screen, look for "console" at the top and click on it
3)Finally enter this command: window.location.reload();
Thats it, after doing this, all my apps start working and if I need to change one of the URL address I do this to refresh and load the new URL.
Thank you

The configuration of allowed apps is cached on the device. When I make changes in the Developer Portal I usually just reboot the device.

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..)

"A server with the specified hostname cannot be found" error for downloading apps on Mac App Store

Frequently I face this issue where whenever I pressed get button to download anything from Mac App store, A message would pop up saying "A server with the specified hostname cannot be found". I didn't find this issue published anywhere as it is.
I faced this issue hence I wanted to share this with other people.
I was told to wait for 10-20 minutes and retry on the App Store but that failed for me. I changed my wifi form 5G to 2.4G thinking maybe it was a band issue.
What worked for me was:
Go to System Preferences
Go to Network Preferences
Click advanced options
Click DNS settings
Click the + (plus) sign
Add 1.1.1.1
Similarly add 8.8.8.8
This worked for me and I hope this works for you too. You can remove these once you're able to download the app you want from app Store. After removing also you'll be able to download apps.
Try this: Make a network setting refresh. Simply go to /Library/Preferences/SystemConfiguration/ and remove the following files, but don't empty the trashcan.
com.apple.airport.preferences.plist
com.apple.network.identification.plist
com.apple.wifi.message-tracer.plist
NetworkInterfaces.plist
preferences.plist
After this, make a restart and your network will get fixed.

Universal Links work in simulator but not on real devices

I added the apple-app-site-association: <domain>/.well-known/apple-app-site-association
I started with the "applinks" and when that didn't work I also added webcredentials and activitycontinuation.
I enabled Associated Domains for this app id and in the project I added applinks:<domain>, applinks:m.<domain> & applinks:*.<domain> in the associated domains which now appear in the entitlements file.
I checked the domain in the apple validation tool https://search.developer.apple.com/appsearch-validation-tool/ and that worked.
I tested it on multiple simulators and in each of them I could go to the website in safari and it showed me the banner above, I also sent a fake message in the Messages and that showed the details and opened the app.
I also tried changing Deployment Target to iOS 10.
But when I try to install it on the device from xCode, either in debug or release configuration or even upload the build to test flight, this doesn't work (Tried on iPhone 5s, iPhone 8 & iPhone XR).
I searched the internet and saw many people saying that universal links did not work for them until they did this and that and I tried every thing they said but I still can't make it work on real devices.
Is there something else I should do to make this work or did I get something wrong?
You have to wait a bit ( from minutes to hours ) after your app is successfully installed and launched to let iOS fetch the associated domain.
You can use a proxy like Charles to check if iOS has make the call.
Got the same issue and fixed by replacing App ID prefix instead of team ID in apple-app-site-association file

Is there a way to get the search result i get in the App Store app on the iOS device? ( How to get the ipa file of "App Store"? )

Updated on 2015-11-1:
One solution I am trying is to start App Store using Applium, so that I can record/monitor iOS UI elements. just like what we did Selenium.
Let's treat App Store as a standard iOS app, is it possible to:
uninstall App Store from my iphone.
get the ipa file of App Store
unzip the ipa file and get the app bundle
run Appium with App Store's app file
Is it possible to get App Store 's ipa file?
======
I want to know the position of my apps when I search on the App Store. When I use the iTunes Search API. I notice the result returned from the iTunes search API for a specific search term are different from the result on the iOS App Store app.
I found This Question is also about this, the owner of that has find out the reason about this condition.
But there is no answer to solve this problem.
Actually I've been trying to build the search request, but it cames that the iOS Appstore is using the HTTPs request, so I don't know what to do with this.
Hope someone can help, I'll be very appreciate.
There is at this time no way to specify that you want the results you would get from an iOS device.
The most obvious solution that comes to mind is to build a search request that appears as I it came from ios in your app code.
I'm sure its possible to determine that by basically proxying an actual iPhone using say your router on your home network to log the traffic from an iphone.
Once you have that you can then basically reverse engineer the call in your app code.
As you can refer from Apple's guidance: Search API, there are too many ways of parameter combination.(Parameters includes:term, country, media, entity, attribute, callback, limit, lang, version, explicit, etc.) So it's almost impossible to find out the way of combination that App Store is adapting so as to get the same search results as users get directly from App Store.
You might want to see if you can get this to work:
In Mac OS X:
Launch iTunes
Under Library menu, click on [Apps] menu.
The iTunes will display all installed app
Right-click on one of those apps
Then click “Show in Finder” option
An alternative to this is simply open the directory of .ipa files stored by using this path: User/Music/iTunes/Mobile Applications
This probably only works with apps you downloaded, but it is worth trying.
It's possible to listen in on https connections by installing a trusted ssl certificate on the device and running traffic through a proxy - basically performing a man-in-the-middle attack on yourself. I've previously used Charles Proxy to do this - here's the guide how to set this up. That way you should be able to see exactly what request the App Store app is sending and what response it is getting. And thus it should also be possible to spoof this request and parse the results elsewhere.

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.

Resources