4

I'm trying to implement a native Android app using the Live Agent Android SDK, however I was unable to find how to create records using the API provided in the SDK.

I want to implement something similar to what the findOrCreate() method does when using the Javascript Live Agent SDK, but all I could find was how to send custom data, which does not create the records the way I want.

Is there a way to do it? If not with this SDK, is there another SDK for that purpose?

1

It take me along time to figure out that Live Agent SDK cannot run findOrCreate(). I do my Application by IOS by open Safari when click to Live Agent button. I think you can do that by open Chrome. Note that you must check the URL again because it may be changed when you open your Chat by your Application. your Url will become: [...salesforceliveagent.com?endpoint=your_live_agent_chat_url] you must get [your_live_agent_chat_url] -> decode -> open url by safari(or chrome)

I used for may customer it was OK.

- (void) webView:(WKWebView )webView decidePolicyForNavigationAction:
  (WKNavigationAction )navigationAction decisionHandler:(void (^)
  (WKNavigationActionPolicy))decisionHandler
    {
        if(webView != self.wkWebView) {
          decisionHandler(WKNavigationActionPolicyAllow);
          return;
        }

        UIApplication *app = [UIApplication sharedApplication];
        NSURL        *url = navigationAction.request.URL;

    if([url.absoluteStringrangeOfString:@"salesforceliveagent.com"].location != NSNotFound) {
            NSString *callUrl = [[url.absoluteString componentsSeparatedByString:@"endpoint="] objectAtIndex:1];
            NSString *decodedUrl = [callUrl stringByRemovingPercentEncoding];;
            NSURL *nsCallUrl = [NSURL URLWithString:decodedUrl];
            if ([app canOpenURL:nsCallUrl]){
                [app openURL:nsCallUrl options:@{} completionHandler:nil];
                decisionHandler(WKNavigationActionPolicyCancel);
                return;
            }
        }
        decisionHandler(WKNavigationActionPolicyAllow);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.