Custom Receiver Not Loading in Chrome Cast Device - android

I have a chromecast app with a custom receiver served through Google App Engine. My friend added my device and his to the Google Cast SDK Developer console.
As done in CastHelloText example app (https://github.com/googlecast/CastHelloText-android), I use the following snippet in my android app:
// configure cast device discovery
mMediaRouter = MediaRouter.getInstance(getApplicationContext());
mMediaRouteSelector = new MediaRouteSelector.Builder()
.addControlCategory(
CastMediaControlIntent.categoryForCast(getResources()
.getString(R.string.app_id))).build();
mMediaRouterCallback = new MyMediaRouterCallback();
Note:
I used my app_id that I got from developer console.
For some reasons, my friend is able to load the custom receiver using the Android app. But I am not able to do so. I have done the following with no help:
1) Restart the chrome cast device several times.
2) Factory reset the device.
My current firmware version: 27946
If I use the app_id from CastHelloText app, the same snippet works fine.
How do I confirm that my chrome cast device has loaded/aware of my custom receiver?

Make sure you have entered the correct serial number (from your device); it is often tricky to read that; take a photo and enlarge that. If problem persists, please contact our support.

Related

'Cannot read property 'listRegistrationsByTag' of undefined' from Microsoft.WindowsAzure.MobileServices.Push.RegisterAsync

This is a Xamarin.Forms app running on Android, based on the Azure getting started Mobile App example.
I'm trying to register a device's id for notification services. Originally I was getting unauthorized, so I relaxed authorization settings on the backend. Now I am getting this error and cannot find a reason why.
I checked and double checked that notification hub has the correct Firebase details that align with the app and cannot see what the problem is here, any help appreciated.
John,
If you set WEBSITE_PUSH_ENABLED=false in your appsettings, does the problem go away?
Can you check your Mobile App's app settings?
Specifically, I am looking for the existence of the app setting "MS_NotificationHubName". If that app setting doesn't exist, you need to add it, with the name of your notification hub.
There is a bug in the Azure App Service Push blade right now. A fix is being rolled out. In the interim, instead of using RegisterAsync(), use the method described in the book http://aka.ms/zumobook - chapter 5.

Integrating Air Watch Android Studio

I am very much new to AirWatch Concept but had gone thoroughly about AirWatch. I have gone through the following links,
http://developer.air-watch.com/android/application-configuration-with-the-android-sdk/
http://developer.air-watch.com/android/android-sdk-setup/
but in vain.
Could anyone please help me regarding the integration of Air Watch in Android ?
Things i have done so far,
I have created app in the https://apidev.awmdm.com, and i have added assignemnts. The question here is, How can i get the assignment details in my android application that were added in the Air Watch Console.
Help is really appreciated.
Update:
I am able to create and push the application from AIR WATCH CONSOLE to my Device. Now, the issue i am facing is, If i am adding some application configuration in the AIR WATCH CONSOLE, i am not able to get those details in my application.
I have gone through the below Url for the above scenario,
https://appconfig.org/android/ which is very much similar to https://appconfig.org/ios/
I have implemented those things that were mentioned in the above url but still then i am not able to get those details.Please let me know if i am wrong anywhere.
I got to know that the key value pairs that were being passed in Air watch console will be coming into com.apple.configuration.managed key in iOS. Does any one have an idea that how these key value pairs will come. As far as i know, they will be handled via Restriction Manager. But no idea/clue how to handle in Android.
Updated:
xml/app_restrictions.xml:
<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<restriction
android:key="ManagedServer"
android:restrictionType="string"
android:title="Managed Server"
tools:ignore="ValidRestrictions" />
<restriction
android:key="#string/mdm_key_managed_server_name"
android:restrictionType="string"
android:title="#string/mdm_key_managed_server_url"
tools:ignore="ValidRestrictions" />
<restriction
android:key="#string/mdm_key_managed_server_url"
android:restrictionType="string"
android:title="#string/mdm_key_managed_server_url"
tools:ignore="ValidRestrictions" />
</restrictions>
oncreate Method :
IntentFilter restrictionsFilter =
new IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED);
BroadcastReceiver restrictionsReceiver = new BroadcastReceiver() {
#Override
public void onReceive(Context context, Intent intent) {
// Get the current configuration bundle
Bundle appRestrictions = myRestrictionsMgr.getApplicationRestrictions();
// Check current configuration settings, change your app's UI and
// functionality as necessary.
Toast.makeText(LoginActivity.this, "Reciever Called", Toast.LENGTH_LONG).show();
RestrictionsManager myRestrictionsMgr =
(RestrictionsManager)
getSystemService(Context.RESTRICTIONS_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
if (myRestrictionsMgr != null) {
Bundle appRestrictions = myRestrictionsMgr.getApplicationRestrictions();
if (appRestrictions != null) {
if (appRestrictions.containsKey("ManagedServer")) {
String mConfigDetails = appRestrictions.getString("Managed Server");
Toast.makeText(LoginActivity.this, "" + mConfigDetails, Toast.LENGTH_LONG).show();
}
}
}
}
}
};
registerReceiver(restrictionsReceiver, restrictionsFilter);
List of Users:
When i am actually trying the other command:
Update:
Created a sample app and published to Play Store. App link as follows,
https://play.google.com/store/apps/details?id=com.manu.samplemdm
Now, its a play store app. When I am sending Application Configuration but unable to receive it in the Application. Its giving me still empty bundle from the application.
Help would be really appreciated.
Help is really appreciated
Beside AirWatch Resources, which tells you how you can create an app and set the app configurations,key-value pairs, to push to your devices, You need to check out Android Restriction Manager API. Follow the steps described in the link.
How the whole process works is, AirWatch controls AndroidForWork environment after you set your MDM as AirWatch. And then, AirWatch manages the device from AirWatch console and it pushes the App Configuration to AndroidForWork in your device. You need to implement Android Restriction Manager to access to these data passed you by your MDM. It goes same for all of the MDMs in the Market.
Update:
In order to install your app into Work Container in the development phase, you can use adb to copy it from Personal Container to Work Container.
First, list all of the active users in the device:
./adb shell pm list users
And later, find the Work User's ID from the List of Users and set it in the command below along with your app's package name and App's Main Activity.
./adb shell am start —user 13 -n “your.apps.package.name/your.main.activity.package.name”
13 up there in the command is the Work User's ID. In my case, it's 13.
For more information about ./adb commands in Managed Profiles, see this link and check the most bottom of the page.
There are a couple of different approaches to integrating with AirWatch. It depends on the technology set you're trying to use. I think these are the 2 that are most relevant to you based on what I see in your post:
AirWatch SDK
AppConfig Standard
Both these approaches can accomplish similar functionality but each have different deployment requirements. It sounds like you have gone with the second approach which is using the AppConfig standard and the native APIs provided by Google to have an app read configuration values delivered through AirWatch.
One important thing to note is the AppConfig standard approach on Android requires the device to support "Android for Work" enrollment which is a relatively newer management protocol released by Google. It's worth noting that AirWatch does support Android for Work enrollment so it may just be a matter of getting your AirWatch test instance configured for "Android for Work enrollment" instead of the traditional older Android enrollment protocol. More information about Android for Work can be found here:
https://enterprise.google.com/android/solutions/personal/
If you're already a customer of AirWatch, it may be helpful to create an account here on their resource portal if you haven't done so already to get access to documentation about how you can setup Android for Work within AirWatch. https://resources.air-watch.com
I hope this helps.

NotificationsRegistrationHandler is not being called on iOS

I have an app working and published in the Apple's app store. We are developing an update with new features and I noticed that the NotificationsRegistrationHandler is not being called anymore on iOS when the user accepts to receive notification (in Android is working fine). Which means the application is not getting the "DeviceToken", so we are unable to send notification. The proc. is very simple, and doesn't look like the issue because it's working for Android devices:
for each
where DeviceType = &DeviceType // enum domain SmartDeviceType
where DeviceId = &DeviceId // Character(128)
DeviceToken = &DeviceToken // Character(255)
DeviceName = &DeviceName // Character(128)
when none
new
DeviceType = &DeviceType
DeviceId = &DeviceId
DeviceToken = &DeviceToken
DeviceName = &DeviceName
endnew
endfor
What I have tried so far:
Generate and install new distribuition certificates and provision profiles.
Rebuild All, Build With This Only, etc.
Tested in "TestFlight" also.
Tested in different devices.
The published app right now is working, however I fear to publish this upgrade and screw up the notification.
I'm using GeneXus Evo 3 U2, .NET generator and Oracle.
Any suggestion how to fix this?
EDIT: Tested with distribuition certificate and sandbox=false, builded for distribuition and sended to testflight, same problem. =/
Have you checked that in the Provisioning Profile (developer.apple.com) the Push Notification service is active:
Enabled Services:
Game Center, In-App Purchase, Push Notifications
I fixed, here is what I did:
Updated from "U2" to "U8". Since "U8" have some OSX and XCode version requirements I updated both to the lastest versions.
Now "NotificationRegistrationHadler" is being called as normal.

Chrome Sender Sample App

I am trying to make an app for personal use that has the same functionality of the chrome sender sample app (https://github.com/googlecast/CastHelloText-chrome)
The only thing I am trying to change is the "SAMPLE APP" at the top of the casted screen. I have registered my device via the console and created a new custom receiver in this receiver i have included a URL for a Google drive HTML document I made (Just a black HTML page: https://www.googledrive.com/host/0B7IBRkdKpfYSRmZCYzJaTUpDamM
I then took my newly acquired application id and injected it into the code replacing the Googles sample app ID... I am using Mongoose to host the webpage locally and after I type a message I get no option to connect to my cast device.
Also I have entered my computers local IP and port number (where I am hosting the sender app) under sender details (chrome). I have tried Google's sample code and it works fine the only thing I have changed is the application ID.
Thanks!
I tried the same thing a week ago and the google drive's trick (to host an html page) doesn't work for me.
Your receiver app (your black html page) need to be accessible online, otherwise it's impossible to connect your sender app to your cast device.
So you must put your html file on a server. Do you have a personnal server to host it ?
I pushed your html file on my server and it's connected to a new App ID. Can you try with this App ID : E46DA3D7
If it's working then your probleme is really Google Drive hosting.
Let me know ;)

What ControlCategory should I use for my android Chromecast app game?

I'm making a game that runs on the Chromecast. I'm stuck where I have to build a MediaRouteSelector. I'm not sure what control category I should use. When I use the code in the examples, the cast button doesn't show up (I do put the real application ID I got from the Dev Console):
mMediaRouteSelector = new MediaRouteSelector.Builder()
.addControlCategory(CastMediaControlIntent.categoryForCast("YOUR_APPLICATION_ID"))
.build();
The Chromecast icon shows up when I change the code to this, though:
mMediaRouteSelector = new MediaRouteSelector.Builder()
.addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
.build();
There are two other categories I could use though, and I want to make sure I'm choosing the correct one.
MediaControlIntent.CATEGORY_LIVE_AUDIO
MediaControlIntent.CATEGORY_LIVE_VIDEO
Since you are building a game, you'd need to write a custom receiver and you'd need to register on the cast dev console to get an application id. That is the ID that should be put in for the "YOUR_APPLICATION_ID". If by doing that you do not see your chromecast, then it means you have not correctly done the registration steps for your device; serial number might have been entered incorrectly or the checkbox to send the serial number to Google may not have been checked.

Categories

Resources