Jump to content
Welcome to our new Citrix community!
  • 0

MAM SDK fails to read policy values


Thomas Zywitzki

Question

Hi,

 

we integrated the MAM SDK into our iOS app and it works fine so far. But we got a problem, that the app can't read the policy values that we set for them.

When uploading the MDX file to the server I for example allow using the camera of the device in the MDX policies. But the app won't allow me to use it, because it can't read that setting and uses the default (which is blocking camera access).

In the console I can see that the SDK outputs messages like this:

[CTXMAMCoreFramework:ERROR:com.citrix.mamsdk.ConfigManagerPerAppVault.com.test.MAMTestApp:103]A:-[CTXMAMDataStorage getDataAsObjectForKey:outError:]_block_invoke: getDataForKey DisableCamera, failed because the value was not found in the data store.
[CTXMAMCoreFramework:WARNING:com.apple.main-thread:103]A:-[CTXMAMConfigManager getConfigAsIdForKey:fromVault:defaultValue:outError:]: [CTXMAMDataStorage getDataAsObjectForKey:] returned with error: Error Domain=CTXMAMDataStorageError Code=90007 "The specified value was not found in the data store." UserInfo={NSLocalizedDescription=The specified value was not found in the data store.}, will return default value instead.
Received notification from CTXMAMNotificationSource_Containment: "Camera" is blocked for this app

Do you have any idea why this happens? If a full log would help, just let me know and I attach it.

Link to comment

5 answers to this question

Recommended Posts

  • 0

Thanks for your answer, it pushed me into the right direction. I did call the SDK initialization right after the app launch, but during debugging I noticed that it was failing.

For the sake of completeness, I'll quickly sum up what I found to be the cause for this:

In the "MvpnTestIOSApp" sample app contained in the SDK package there is this line of code just before calling the SDK initialization:

double appCoreVersion = com.citrix.ios.CTXMAMAppCore.Constants.CTXMAMAppCoreVersionNumber;

Since that variable isn't used anywhere in the code after it's definition, I did not take it over to our code. It's strange, but for some reason it seems to be necessary. At least in my test the SDK initialization would only be successful when I put that line before the initialization call. We use the Xamarin iOS Technology preview version of the SDK by the way, don't know if that makes a difference compared to the native iOS version.

Link to comment
  • 0

I spoke with a colleague that worked on Xamarin and he confirms your findings. It's in our documentation: https://developer.cloud.com/citrixworkspace/mobile-application-integration/xamarin-ios/docs/integrate-xamarin-mam-sdk#initializing-the-mam-sdk

 

The problem is that the optimizer removes the library if it's not referenced at all. There isn't any other way to give the C# compiler any hints to include the library. At least for now this is the solution to make it include the library.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...