cancel
Showing results for 
Search instead for 
Did you mean: 

MAFLogon iOS - how to customize port and disable 'Show Detail' switch

Former Member
0 Kudos

Dear All,

As title above, May I know how to customize MAFLogin setting profile at server port for http/htts and disable 'Show Detail' switch.

Thank you.

Regards

Marcus

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marcus,

You can set default values for server port for Https/Http in the MAFLogonOperationContextDefaultValues.plist which is inside MAFLogonManagerNG.bundle. In the plist, for the key idMAFLogonOperationContextTypeRegister you can add two new items keyMAFLogonOperationContextServerPortSecure (for HTTPS) and keyMAFLogonOperationContextServerPortNonSecure (for HTTP) and set the default values to it.

And to disable the Show Details switch you can use the following code.


-(void)willRenderUIFromUIContext:(MAFLogonUIContext *)aUIContext

{

  

    [[[[aUIContext rawValue] objectForKey:keyMAFLogonUIContextGroupDescriptors] objectAtIndex:1] setValue:[NSNumber numberWithInt:1] forKey:keyMAFLogonUIGroupDescriptorIsHiddenByDefault];

   

}

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

May I know where should i add the code to disable show detail?

Regards,

Choong

Former Member
0 Kudos

Hi Choong,

You can put these codes in the class where you will handle the Logon activities.

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

I tried to put these code in the class where i call self.logonHandler from my login screen.

but it got error because  willRenderUIFromUIContext not found.

please advise.

Regards

Choong

Former Member
0 Kudos

Hi Choong,

Have you  imported MAFLogonUICustomizationDelegate,.h file and  confirmed to #import "MAFLogonUICustomizationDelegate" protocol in your header file?




#import "MAFLogonUICustomizationDelegate.h"

@interface MyLogonHandler : NSObject<MAFLogonUICustomizationDelegate>




You have to call these method in the class where you are calling logonFinishedWithError method.(To be presice, in the class where you are doing  MAFLogonNGDelegate implementation)

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

Thanks for pointing the right class to adding the code, i added those code but the 'Show Detail' switch still visible and allow to switch on to configure the port.

I want to disable the switch so that user cannot edit the server port and others configuration.

Please help.

Regards

Choong

Former Member
0 Kudos

Hi Choong,

Do you want to hide the 'Show Detail' switch?

Regards,

Dhani

Former Member
0 Kudos

Yes Dhani. I want to pre-configure the detail setting and hide the "Show Detail" switch , so that the user just require to enter the username and password to login the application.

Former Member
0 Kudos

Hi Choong,

In that case, you can put the values for all the fields in keyMAFLogonOperationContextHideRegistrationFields in MAFLogonUIOptions.plist to YES except for keyMAFLogonOperationContextBackendUserName and keyMAFLogonOperationContextBackendPassword.

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani,

It's work like charm.. thank you very much.

Regards

Choong

Answers (0)