Open tatham opened 1 year ago
@tatham - Nothing about Ionic has done from Citrix. If you encounter any problems, we are happy to support.
Thanks, I’m looking at creating a wrapper for each plugin. I only need the microVPN functionality at this stage, so can I add just the core and network plugins? The Readme describes adding them all…
@tatham - we don't suggest that, but in theory you can remove some of them Besides CTXMAMNetwork+CTXMAMCore, you also need CTXMAMAppCore to fetch policies from CEM server, otherwise the network access policy can only be unrestricted
Thanks @timliu55, I'll include them all. I'm having a few issues, wondering whether anyone can suggest what the underlying problem might be, or how to better troubleshoot?
Our Ionic app deploys via Secure Hub. When opening the app, it switches to Secure Hub, as expected, and in the logs I see messages about the microVPN being successfully initialised (along with other MAM SDK components) and successful Secure Hub authentication.
Attaching to the app running on the iPad from XCode has only worked once, most of the time it gives me an error about being denied :-(
Any suggestions about what might be happening, or approaches to troubleshooting?
Bit of an update:
@tatham Typically speaking, the error 'server with specified hostname could not be found' indicates the network plugin does not succeed to be initialized - you need to collect managed app logs from secure hub and then find below message in app logs "Network SDK is initialized."
Thanks @timliu55 Did you notice that in the situation I described, even though the login attempt fails with the 'server ... could not be found', if I then click on a link on the same login page, without doing anything else, the server URL opens without any problem? In other words, there is a subtle difference between inAppBrowser opening the URL and submitting a request to the same server as part of the login form submission. Yes, as I described: I see messages about the microVPN being successfully initialised (along with other MAM SDK components).
Another observation: when calling the initializeSDKs function, neither of the callbacks ever fires, not even if I add logging in the CtxMAMCoreBridge.js file that is part of the core plugin...
I started working on this again, as we never got it working. I'm using the recently released 23.8.0 version. I had to make a change in the CtxMAMCoreBridge.m file to get the callbacks working. (Now I'm getting the expected success or failure responses when calling initializeSDKs).
Our app uses the IBM MobileFirst plugin for authentication. The problem I'm having is that although the microVPN has successfully initialised, the login page reports 'specified hostname could not be found'.
There are two ways that I can get around this (obviously neither are acceptable):
I'm guessing that it's all about the timing of the various calls and events in the app, but I've tried everything I can think of (including sleeping for a few seconds) and it won't work the way it should.
Any suggestions about what the issue might be, or troubleshooting steps?
@tatham - I am not sure what happened if I cannot see the SDK logs, my suggestions are
@tatham
I started working on this again, as we never got it working. I'm using the recently released 23.8.0 version. I had to make a change in the CtxMAMCoreBridge.m file to get the callbacks working. (Now I'm getting the expected success or failure responses when calling initializeSDKs).
Could you share what you changed in CtxMAMCoreBridge.m? Because I'm also not getting any callback.
@ninaDeimos
Could you share what you changed in CtxMAMCoreBridge.m? Because I'm also not getting any callback.
I'm not an Objective C programmer, and the change I made doesn't seem to be necessary, but this modified code worked for me at the time:
- (void) initializeSDKs:(CDVInvokedUrlCommand*)command {
CTXMAMLOG_Info(CTXLog_SourceName, @"Core SDK delegate set.");
[CTXMAMCore setDelegate:(id<CTXMAMCoreSdkDelegate>) [MAMCoreSDK sharedInstance]]; //TODO: nonnull check or log
CTXMAMLOG_Info(CTXLog_SourceName, @"Invoking initialized sdks from plugin.");
[CTXMAMCore initializeSDKsWithCompletionBlock: ^(NSError * nilOrError) {
CTXMAMLOG_Info(CTXLog_SourceName, @"initializeSDKsWithCompletionBlock nilOrError : %@",[nilOrError localizedDescription]);
if (!nilOrError) {
[CTXMAMCore setCordovaInfoAfterBeingInitialized];
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK] callbackId:command.callbackId];
}
else {
NSDictionary* errorInfoDict = @{ kCoreErrorCode : @(nilOrError.code), kCoreUserInfoMsg : nilOrError.localizedDescription};
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:errorInfoDict] callbackId:command.callbackId];
}
}];
}
I basically just moved the return statement into the if...else block.
@tatham Thank you. I don't understand why, but in my case it also helped. I'm getting the success callback now.
But I'm still not getting the registerSdksInitializedAndReady
event. Did that work for you or did you not use it?
@ninaDeimos No, registerSdksInitializedAndReady
has never worked for me either, I managed to get by without it.
Just curious as to whether anyone has done any work to get the Cordova iOS plugins working in an Ionic app?