-
Notifications
You must be signed in to change notification settings - Fork 15
Somehow, it doesn't work for Android #2
Comments
Hi George, 1.0.1 or 1.0.2 shouldn't make any difference. 1.0.2 only added some extra description and contains no bug fix or new feature. However, you can update to 1.0.2 by first removing it: The command is "remove", not "rmv". As for the error message, sounds like it's coming from the Airwatch Console when you try to enable the "Application Configuration" setting, is that correct? If that's the case, it shouldn't be caused by the app itself. It's probably related to the app settings in AirWatch. You may want to contact AirWatch to see what's causing that error message. Thanks, |
Closing this issue since this doesn't appear to be a problem with the plugin itself. |
Having the same issue as well, and my suspicion leans towards it being the plugin. Reviewing the Google documentation for Setting up Managed Configurations, it appears there should be additional properties injected into the AndroidManifest.xml file? |
If I'm reading the Android documentation correctly for configuring an application for managed configurations, the plugin needs to do the following to enable the functionality:
As far as I can tell looking at the plugin, it's doing neither. My suspicion is supported by the fact that we don't define anything in Cordova's |
@theaccordance Thanks for the comments. Are you also getting error message from AirWatch console? We had it working with AirWatch without the need to define any restriction. We will investigate to see if there are cases where restrictions may be needed. |
Hi Leon, Thank you for the message!! Yes, we are getting the error message from AirWatch console. Is it possible you can give us some direction where the setting/configuration part we can check in Airwatch console? George |
Hi George @ghuang0207 , I'm not sure exactly what to check. I would think AirWatch should know since apparently they are checking for something when they throw the error message. Is your apk file uploaded directly to AirWatch, or do you have it in another app store like Google Play and provide a link in AirWatch? Another poster has just commented on this issue. Maybe you can try adding the restriction property and file and see if that solves the problem? Thanks, |
@lpchanora Can't speak for Airwatch, my Android woes relating to this plugin are coming from my Mobile Iron customers |
I think @theaccordance is onto something, the Documentation from google clearly states "To provide externally managed configurations: That leads me to believe that AirWatch, or Mobile Iron is using the Google Play APIs to check for the keys that can be set. If the app has not correctly declared those in the application manifest it will not be able to read them. Should be fairly easy to test this by manually adding this data to the manifest to check. If that fixes it, it shouldn't be that hard to add functionality to the plugin to write this data programmatically when built. |
@audioeng I think your are right AirWatch asked us to deploy apk through Google Play ( a must ).. |
To Leon @lpchanora , We deployed our APKs to AirWatch through Google Play. George |
Here's a patch I'm testing: #3 The PR itself is not ready for merge, the changes I'm showing need to be optimized further to function as a proper plugin. What the patch is doing:
I'll report back in after I hear from my customers |
To @theaccordance Joe, Thank you very much for all the help! Actually all we need was just for Airwatch to send us "EnrollmentUser" key and value (string). But I don't know how to configure the app_restrictions.xml to do that. Or can I not set any restriction for the app? platforms/android/res/xml/app_restrictions.xml |
@ghuang0207 https://developer.android.com/work/managed-configurations.html if you want context on the code changes I've shared in the PR. Keep in mind, that's not the final solution to fix the plugin, probably better to look at it as a POC currently. I'm still waiting for feedback from my customers if this addresses the problem they're having configuring our app with Mobile Iron. Assuming my changes fix the problem, then the next step is to refactor my solution so the custom configurations are defined in your project's |
The patch so far looks promising. One of my colleagues tested our revised build against an AirWatch demo & can now see config options for our Android App: I still don't have confirmation yet that the app is able to read the values provided through the MDM provider, but we're hopeful that the scope is just limited to the missing properties for AndroidManifest & the Restrictions doc. I spent some time last night reviewing the user-defined data that still needs to be abstracted from the plugin, and I'm considering the following solution:
<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
<restriction
android:key="KEY1"
android:title="KEY 1 NAME"
android:description="@string/appconfig_key1"
android:restrictionType="string" />
<restriction
android:key="KEY2"
android:title="KEY 2 NAME"
android:description="@string/appconfig_key2"
android:restrictionType="bool"
android:defaultValue="false" />
</restrictions>
<plugin name="cordova-plugin-emm-app-config">
<variable name="APPCONFIG_RESTRICTIONS" value="path/to/app_restrictions.xml" />
</plugin>
The parsing is by far the most difficult part of this solution, but thankfully Ionic Plugin Deeplinks already has done this and is serving an excellent reference. Let me know your thoughts, I hope to have this completed sometime next week. |
To @theaccordance: This is great! Thank you very much, and I think this new plugin will help many ionic developers in the future. I have a question though: We would like to obtain the keyname: EnrollmentUser from AirWatch, so should I add that into the restrictions.xml file as well? Like below?
However, I also notice that, we can add any key and value from the AirWatch Console. This has been making a lot of confusion... Is there a way I can do in the restrictions.xml file to allow whatever key/value added from AirWatch console? Again, thank you for your help.. George |
@ghraml ignore As far as your question about the restrictions file - I can't answer. I'm just a guy who knows his way around a cordova project, read the manual (the link I provided you earlier), and uses moments like this to give back to the open source community. You'll need to talk to someone more versed with Android & Airwatch on that. |
Just got word that the patch is working for our customers, so I'll finish revising our patch into a workable PR for the plugin. Probably be a couple weeks until I complete this, the downside of open source is that it generally has to take a back seat on the priority list. If anyone wants to pick up where I've left off, I'll be more than happy to clarify spec on what's left. @lpchanora would it be possible to at least keep this issue open until we've finalized the PR & it's been accepted? It'll make it easier for others to find |
@theaccordance Thanks for sharing the result. I will keep the issue open. |
@theaccordance Great! I haven't had time to test out your changes, but they look good as far as I can tell and I like your proposal to require the user to make their own app_restrictions.xml file. Looking forward to a workable PR, I should have some time to test it when you have it ready! Thanks! |
Has there been any progress on this? I am trying to incorporate the fix described above and still receiving an empty _appconfig object. Not sure about step 3 mentioned by theaccordance. Im trying to add a server url from Airwatch. |
I haven't finalized the solution so it's release-worthy, and it'll probably be at least a week until I have the capacity to do so myself - unfortunate reality of open source. You can take a look at the open PR i have submitted and engineer your own shim in the meantime. I'll see if I can recruit someone internally to help get it across the finish line sooner, I do know some of them are looking for ways to contribute to open source in general. |
Ok thank you. Yes I have edited the plugin.xml and added an app_restrictions.xml under /src/android/ as well as platforms/android/res/xml . Not sure what else I am missing. My understanding is that the plugin should now add the necessary entry to the AndroidManifest, pointing to the restrictions available. Still when debugging my EmmAppConfig _appconfig is returning empty. I am using Cordova, not sure if that changes anything though. |
Hi @bhutchison , this plugin has not been updated to look at plugin.xml as proposed by @theaccordance . However, if the issue is just a missing app_restrictions.xml, you don't really need an updated plugin. You can just manually modify AndroidManifest.xml to add a
For more information, please refer to: |
Thank you @lpchanora. I have followed these steps but still not seeing any key values. If anyone has this working I would be interested to see your configuration and use of the plugin. Im wondering if its something to do with my Airwatch config. |
I think the point is that this plugin doesn’t yet add your variables
automatically, you need to create and configure the xml file manually.
Yes, AppConfig requires Android Enterprise (formerly Android for Work) in
my experience.
…On Thu, Oct 5, 2017 at 7:51 AM Barry ***@***.***> wrote:
Thank you @lpchanora <https://github.com/lpchanora>. I have followed
these steps but still not seeing any key values. If anyone has this working
I would be interested to see your configuration and use of the plugin. Can
anyone clarify for me whether Android for work is required on the device
for Airwatch? Im wondering if its something to do with my Airwatch config.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQVLdexv0MsyBU5qC__-6Z-nKSdPInvtks5spMKvgaJpZM4O9f_2>
.
|
I am using ionic2 with your plugin. We are using airwatch in our enterprise.
We published our code to Google Play, set as internal access only. We saw an error message "This app doesn't support app configuration", when we tried to enable "Send Application Configuration" from the airwatch console. ( the same exact code works for iOS).
Also I checked my config.xml file, the version is: ~1.0.1 Does that matter? I tried to do:
cordova plugin rmv cordova-plugin-emm-app-config and
cordova plugin add cordova-plugin-emm-app-config
but I still get version 1.0.1.. I even tried cordova plugin add [email protected]
Could anyone please help me?
We have been running out all the solutions...
Thank you
George
The text was updated successfully, but these errors were encountered: