Google Cast iOS sample app not scanning for devices - ios

Trying to use this sample app provided by Google: https://github.com/googlecast/CastHelloVideo-ios
It is not asking to connect with my Chromecast, or even scanning for receiver devices. There is only the "Cast Video" button that alerts "Not Connected - Please connect to Cast device" when clicked. I understand there is a whitelisting/registration process for styled and custom media receiver apps, but there is supposed to be a default media receiver app built into the Chromecast that I should be able to use right away. How can I make it scan for devices?

Did you follow the instructions for setting up that app? Unless you use your own App Id or you update the sample to use the default app id, it won't find any device; it is doing the scanning. In addition, please use the GitHub's issue tracker to ask questions about that and other cast samples if you run into any issues when trying to run them.

Related

is it possible to turn off wifi or switch iPhone to offline mode in codes in swift 4?

I want to know is there any way to turn on or off the iPhone wifi or switch the device to offline mode in codes in swift 4 or not
I know that apple may not allow the app can do such things to be distributed in App Store But it's Not important I just want to know is there any codes to do that or not (Just in swift 4)
5 Solutions Collect From Internet About “How to turn off internet connection, bluetooth and WIFI programmatically?”
Ans
You can’t. Apple does not allow 3rd party apps to change global system settings like that.
There is no API available to control cellular data,wi-fi,bluetooth within in an app , User have to go to settings to enable or disable cellular data,wi-fi and bluetooth.
This is not possible in iOS unless you jailbroke your device. Apple is not allowing any apps developer to access wifi/bluetooth. You can only check wifi/tooth is connected or not.
You can’t do that using the iOS application. Apple not allowing it.
Legally there is no way to do it. Even somehow if you are manage to do it, Apple will reject your app while submitting to AppStore.
update
I am not sure the following code will work or not, try once, initially add the header file to your project folder and create the bridging header to your code ,then use the below code where you need , for ref purpose I taken the answer from here
var tempSBWifiManager: SBWiFiManager = objc_getClass("SBWiFiManager")
// Steal a class from SpringBoard
tempSBWifiManager.sharedInstance().isWiFiEnabled = false

How to dismiss or suppress permission issue automatically related to Contacts, Camera, Microphone in iOS Application

I have been working on a project wherein i made a framework where i automatically test the SDK my company is developing.
I have created my dummy sample application for all the platforms(iOS, Android, OSX, Windows) which makes use of this SDK and i thereby test this SDK, call the SDK API's do my work.
Now my question is for iOS i get permission alerts for Contacts, Camera and Microphone first time whenever i use the API's of my SDK which internally is invoking something in iOS framework. Is there a way i can automatically give this permission to my application ?? i know it's iOS own Security concern and it's correct. But how do i bypass it.
I see there is Apple's XCUITest framework but i don't want to open my application via it.
Right now i handle this alert manually but i need to implement Continuous Integration(using ios-deploy), i have done everything but i can't handle these alerts automatically.
Can someone please help me.. Thanks!!

Modify the BLE device name

I am working on an iPhone app and this app send command to a board through BLE module. the board controls some motor to move around.
I do code on iOS app and another guy do the code on Arduino. There is a BLUGiga 112 module on the board.
Now, in my iOS app, I can search out available BLE devices, but the detected device name is not always what I want.
The device name defined in gatt.xml file can always be detected on the iOS app. But I want user to be able to change the name by iOS app while the name in xml is static. So I let another hardware engineer write some code to accept new name from iOS and store in flush and then broadcast back to iPhone. I can pass the name from iOS app and the name is stored in device successfully. But next time, when I open iOS app and try to search around, the new name is not always be detected.
Anybody can tell me why? or what should I do to get the rename function done?
iOS prevents that Service from being usable by a developer. It also caches that data and it is hard to clear that cache.
I ended up making a custom Characteristic that an app could write to. The firmware would handle that write request and then update the device name and advertising packet. It's seems hacky, but I wasn't able to find a better solution.
Section 3.12 (page 24) documents the fact iOS does not let a developer use that Service (and a couple others) https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf

How Apple TV is used to control Homekit Accesory

I have created an application for Homekit which works fine when both accessory and device is in same network.
I read somewhere that Apple TV is required to control accessories remotely.
Can anybody please tell how to achieve this exactly?
No you can not pair homekit with the appleTV. You can use the remote app either from you iPhone or iPad
If you have Apple TV try to set it up.
I have given the details.
I have done a much workaround for this. First of all handling things by our own is not preferable for multiple users.
I had this query that how all configuration done on one device will reflect on another device for same home. Unfortunately apple didn't provided much information on this and they also didn't clarify that Apple TV will require or not(As I have referred to some reports that says Apple TV will use as intermediator between iOS devices.
Now at application side i have tried to add User to home. There is a HMUser class and we can add user to any home that we want to sync. I was running my app in iOS 8.1 in both the devices, I was also logged in to icloud and keychain access was also enabled.
Now i have tried to add user using method of HMHome class
-addUserWithCompletionHandler()
I shows a popup in which we need to enter the email id of user to which we want to give access to current home.
But it didn't work. I always get error "notification not enable at remote side"
I think that login to Apple TV is require for adding user. I am not sure about this, Apple hasn't clarify on this too. I don't have Apple TV if you have try to login in it and use two other iOS devices to give access to any icloud account.
Also revert me if it works.
I have been working on HAP Over iCloud concept since last 2 to 3 hours. The beauty in this concept is according to the documentation we should need the following things.
1. Apple tv 3rd generation.
2. Have to use same iCloud account in both apple tv and iOS device.
3. This is most important that Apple tv and Accessory should be on same network.
Eventhough you are on different network it is able to pass the switch on/off,brightness increase/decrease ... actions. For this you can use siri commands or programmatically call the accessory write value functionality
Note : As I know I think when you are passing the commands to the Accessory it checks for the iCloud account in the apple tv and from there it is passing the commands to the Accessory.

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