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

Trying to integrate Citrix MAM in Xamarin Form Project.I got the code to integrate Citrix MAM in Xamarin Android but there is no code for Xamarin IOS


Aditya Teje

Question

11 answers to this question

Recommended Posts

  • 0

  

On 10/25/2022 at 3:39 PM, Hui Zhang said:

It's not yet officially supported but there's a tech preview version, you can try with that, hope it helps.

https://github.com/citrix/citrix-mam-sdks/releases/tag/21.7.0.12-TechPreview

Thank you for your reply

 

I tried link given by you - https://github.com/citrix/citrix-mam-sdks/releases/tag/21.7.0.12-TechPreview

 

Although Xamarin IOS code has been worked well but When I tried to execute Xamarin form code and getting following error in iOS app.

 

1. App was frozen out after coreService.InitializeSDKs() call which is there in App.xamal.cs page -> OnStart() mothod.

-  This issue was getting due to -  double appCoreVersion =  com.citrix.ios.CTXMAMAppCore.Constants.CTXMAMAppCoreVersionNumber. I have removed this and issue resolved.
 

2. Contineously getting following message. Don't know why?

canOpenURL: failed for URL: "zenprisedmpostenroll://" - error: "This app is not allowed to query for scheme zenprisedmpostenroll"

 

3. I have initialised SDK by using :-


- await coreService.InitializeSDKs() in App.cs - getting following messages

CTXMAMCore - Now initializing CTXMAMCore SDK
CTXMAMCore - Now initializing CTXMAMAnalytics SDK
CTXMAMCore - Now initializing CTXMAMLocalAuth SDK
CTXMAMCore - Now initializing CTXMAMContainment SDK
 CTXMAMCore - Now initializing CTXMAMCompliance SDK
CTXMAMCore - Now initializing SmartNetwork SDK

 

but control is not going after await coreService.InitializeSDKs()  statement and looks like it stuck somewhere. 

 

- Tried this code as well in AppDelegate.cs code as well


  CTXMAMCore.InitializeSDKsWithCompletionBlock(initResultHandler: (NSError errObj) =>
  {
                if (errObj == null)
                {
                    // If MAM SDK initialization succeeds, this code will be executed.
                    Console.WriteLine("MAM SDK initialization succeeded");
                }
                else
                {
                    // If MAM SDK initialization fails, this code will be executed.
                    Console.WriteLine("MAM SDK initialization failed - {0}", errObj);
                }
     });
            

In above case , Control is not going inside CTXMAMCore.InitializeSDKsWithCompletionBlock(initResultHandler: (NSError errObj) => block.
  

I am really confused wether Citrix SDKs have been initialised or not or do we need to upload MDX on CEM server to test this.

 

Please help me out to resolve this

 

Thank you

Link to comment
  • 0

  

On 10/25/2022 at 3:39 PM, Hui Zhang said:

It's not yet officially supported but there's a tech preview version, you can try with that, hope it helps.

https://github.com/citrix/citrix-mam-sdks/releases/tag/21.7.0.12-TechPreview

Thank you for your reply

 

I tried link given by you - https://github.com/citrix/citrix-mam-sdks/releases/tag/21.7.0.12-TechPreview

 

Although Xamarin IOS code has been worked well but When I tried to execute Xamarin form code and getting following error in iOS app.

 

1. App was frozen out after coreService.InitializeSDKs() call which is there in App.xamal.cs page -> OnStart() mothod.

-  This issue was getting due to -  double appCoreVersion =  com.citrix.ios.CTXMAMAppCore.Constants.CTXMAMAppCoreVersionNumber. I have removed this and issue resolved.
 

2. Contineously getting following message. Don't know why?

canOpenURL: failed for URL: "zenprisedmpostenroll://" - error: "This app is not allowed to query for scheme zenprisedmpostenroll"

 

3. I have initialised SDK by using :-


- await coreService.InitializeSDKs() in App.cs - getting following messages

CTXMAMCore - Now initializing CTXMAMCore SDK
CTXMAMCore - Now initializing CTXMAMAnalytics SDK
CTXMAMCore - Now initializing CTXMAMLocalAuth SDK
CTXMAMCore - Now initializing CTXMAMContainment SDK
 CTXMAMCore - Now initializing CTXMAMCompliance SDK
CTXMAMCore - Now initializing SmartNetwork SDK

 

but control is not going after await coreService.InitializeSDKs()  statement and looks like it stuck somewhere. 

 

- Tried this code as well in AppDelegate.cs code as well


  CTXMAMCore.InitializeSDKsWithCompletionBlock(initResultHandler: (NSError errObj) =>
  {
                if (errObj == null)
                {
                    // If MAM SDK initialization succeeds, this code will be executed.
                    Console.WriteLine("MAM SDK initialization succeeded");
                }
                else
                {
                    // If MAM SDK initialization fails, this code will be executed.
                    Console.WriteLine("MAM SDK initialization failed - {0}", errObj);
                }
     });
            

In above case , Control is not going inside CTXMAMCore.InitializeSDKsWithCompletionBlock(initResultHandler: (NSError errObj) => block.
  

I am really confused wether Citrix SDKs have been initialised or not or do we need to upload MDX on CEM server to test this.

 

Please help me out to resolve this

 

Thank you

Link to comment
  • 0
On 11/10/2022 at 4:00 PM, Aditya Teje said:

  

Thank you for your reply

 

I tried link given by you - https://github.com/citrix/citrix-mam-sdks/releases/tag/21.7.0.12-TechPreview

 

Although Xamarin IOS code has been worked well but When I tried to execute Xamarin form code and getting following error in iOS app.

 

1. App was frozen out after coreService.InitializeSDKs() call which is there in App.xamal.cs page -> OnStart() mothod.

-  This issue was getting due to -  double appCoreVersion =  com.citrix.ios.CTXMAMAppCore.Constants.CTXMAMAppCoreVersionNumber. I have removed this and issue resolved.
 

2. Contineously getting following message. Don't know why?

canOpenURL: failed for URL: "zenprisedmpostenroll://" - error: "This app is not allowed to query for scheme zenprisedmpostenroll"

 

3. I have initialised SDK by using :-


- await coreService.InitializeSDKs() in App.cs - getting following messages

CTXMAMCore - Now initializing CTXMAMCore SDK
CTXMAMCore - Now initializing CTXMAMAnalytics SDK
CTXMAMCore - Now initializing CTXMAMLocalAuth SDK
CTXMAMCore - Now initializing CTXMAMContainment SDK
 CTXMAMCore - Now initializing CTXMAMCompliance SDK
CTXMAMCore - Now initializing SmartNetwork SDK

 

but control is not going after await coreService.InitializeSDKs()  statement and looks like it stuck somewhere. 

 

- Tried this code as well in AppDelegate.cs code as well


  CTXMAMCore.InitializeSDKsWithCompletionBlock(initResultHandler: (NSError errObj) =>
  {
                if (errObj == null)
                {
                    // If MAM SDK initialization succeeds, this code will be executed.
                    Console.WriteLine("MAM SDK initialization succeeded");
                }
                else
                {
                    // If MAM SDK initialization fails, this code will be executed.
                    Console.WriteLine("MAM SDK initialization failed - {0}", errObj);
                }
     });
            

In above case , Control is not going inside CTXMAMCore.InitializeSDKsWithCompletionBlock(initResultHandler: (NSError errObj) => block.
  

I am really confused wether Citrix SDKs have been initialised or not or do we need to upload MDX on CEM server to test this.

 

Please help me out to resolve this

 

Thank you

 

does the log print fine? "MAM SDK initialization succeeded" or "MAM SDK initialization failed - {0}"?

Link to comment
  • 0

Hey Aditya,

 

Excited to know that you were trying to use Citrix MAM for Xamarin iOS and made such progress.

Yes, you have to upload the mdx file to a CEM server and enroll your device to this CEM server before the MAM SDK can be initialized

And if you check the zip file, you can find the related guidance under \Documentation\README-iOS.md, and go to last 2 section 
## Embed the IPA file into the MDX file

## Upload the MDX file

 

Hope this helps, and your further feedback will be very welcome

 

Regards

Link to comment
  • 0
19 hours ago, Tim Liu said:

Hey Aditya,

 

Excited to know that you were trying to use Citrix MAM for Xamarin iOS and made such progress.

Yes, you have to upload the mdx file to a CEM server and enroll your device to this CEM server before the MAM SDK can be initialized

And if you check the zip file, you can find the related guidance under \Documentation\README-iOS.md, and go to last 2 section 
## Embed the IPA file into the MDX file

## Upload the MDX file

 

Hope this helps, and your further feedback will be very welcome

 

Regards

Thank you for your reply.

 

I have done with following steps

1. Create MDX file

2. Create IPA from Xamarin Forms app

3. Embed IPA into MDX

4. Upload MDX on CEM (Xen Mobile test Environment)portal.

5.  Download IOS app on mobile

 

We have applied "MvpnNetworkAccessTunneledWebSSO" policy from Portal also preset the same policy in Policy_metadata.xml file.

But it looks like micro tunnelling aspect is not working. When we hit the URL, we were not getting any response from server. Even in Log also we could not seen any connection with our server.  URL is been configured already with our VPN .

 

Any help would be appreciated.

 

 

Link to comment
  • 0
On 12/8/2022 at 1:56 PM, Aditya Teje said:

Thank you for your reply.

 

I have done with following steps

1. Create MDX file

2. Create IPA from Xamarin Forms app

3. Embed IPA into MDX

4. Upload MDX on CEM (Xen Mobile test Environment)portal.

5.  Download IOS app on mobile

 

We have applied "MvpnNetworkAccessTunneledWebSSO" policy from Portal also preset the same policy in Policy_metadata.xml file.

But it looks like micro tunnelling aspect is not working. When we hit the URL, we were not getting any response from server. Even in Log also we could not seen any connection with our server.  URL is been configured already with our VPN .

 

Any help would be appreciated.

 

 

Hey Aditya,

 

I wish you had a good weekend.

For your step 3. Embed IPA into MDX, I am afraid currently the MDX toolkit still cannot work well with Xamarin IPA, but we'll try to fix it in the near future.

For now, can we try the way written in PDF first, which is called side load? 

 

1. just your step 1, create MDX file (with a size of about 330KB)

2. just your step 4, Upload MDX on CEM (but just upload the MDX of 330KB this time)

3. Install the iOS app by running the project from Visual Studio

4. Allow WLAN & Cellular for the iOS app, and relaunch the iOS app

5. Click fetch button or web view button, and it should work now

 

If we have good luck, check the application output window, and there should be log like "Now initializing SmartNetwork SDK"

And if not, please collect the log and paste it here.

 

Regards

Link to comment
  • 0
On 12/12/2022 at 10:02 AM, Tim Liu said:

Hey Aditya,

 

I wish you had a good weekend.

For your step 3. Embed IPA into MDX, I am afraid currently the MDX toolkit still cannot work well with Xamarin IPA, but we'll try to fix it in the near future.

For now, can we try the way written in PDF first, which is called side load? 

 

1. just your step 1, create MDX file (with a size of about 330KB)

2. just your step 4, Upload MDX on CEM (but just upload the MDX of 330KB this time)

3. Install the iOS app by running the project from Visual Studio

4. Allow WLAN & Cellular for the iOS app, and relaunch the iOS app

5. Click fetch button or web view button, and it should work now

 

If we have good luck, check the application output window, and there should be log like "Now initializing SmartNetwork SDK"

And if not, please collect the log and paste it here.

 

Regards

Hello Tim,

Thanks for your reply. I followed the steps which you have mentioned but still there is no luck.

I have installed the Xamarin forms - IOS app separately on device and uploaded plain MDX file(without IPA embedded on CEM) but still we are facing issues in our Xamarin forms app.

Do we have any other example of Citrix MAM with Xamarin Forms apart from https://github.com/citrix/citrix-mam-sdks/releases/tag/21.7.0.12-TechPreview - this

 

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