199
Views
10
Comments
Cordova plugin for Twilio Client
Question

Hi!

I'm trying to use this plugin on a mobile app. I installed the plugin as supposed, but when I try to use it I get an error saying that Twilio is not defined. When I run "cordova.plugins" on the console it returns "undefined". What am I missing?

Thanks,
Diogo

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi Diogo.

How are you doing the validation to check if the plugin is loaded or not?

Maybe you need something like this: 

if(typeof(Twilio) === "undefined")
    $parameters.IsLoaded = false;
else
    $parameters.IsLoaded = true;



Cheers,

GM

2017-07-12 04-45-27
Thong

Thank you very much for sharing good.

2023-05-29 08-29-44
Diogo Fonseca
Staff

Gonçalo, thanks for your help. I've already solved that problem by importing the www/tcPlugin.js. Everything's working properly in the Android app. 

But now I getting this error generating the iOS app:
"iOS: Error compiling Cordova plugin: [AppName]/Plugins/com.phonegap.plugins.twilioclient/TCPlugin.m."

I looked in ServiceCenter for details, but there are none. Can you help me with this please?

Thanks,
Diogo

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi Diogo.

Did you check Service Center, inside the Mobile Apps logs?

Did you add all the certificates and credentials for your apple account?

Or can you provide more details?

Cheers,

GM

2017-08-09 19-45-50
John Snow

Diogo Fonseca wrote:

Gonçalo, thanks for your help. I've already solved that problem by importing the www/tcPlugin.js. Everything's working properly in the Android app. 

But now I getting this error generating the iOS app:
"iOS: Error compiling Cordova plugin: [AppName]/Plugins/com.phonegap.plugins.twilioclient/TCPlugin.m."

I looked in ServiceCenter for details, but there are none. Can you help me with this please?

Thanks,
Diogo

Hi Diogo,
I'm getting the same Error "Twilio is undefined".
Please help me to understand how did you import www/tcPlugin.js. Is it done inside the same cordova plugin module? or is it a part of a core module from where plugin is been called?



2023-05-29 08-29-44
Diogo Fonseca
Staff

Gonçalo,

I checked the Mobile Apps logs but it just showed the same error with no more details.
I added all the certificates and credentials necessary for the app generation. When I generate it without the plugin it compiles perfectly.
Maybe the plugin itself has some error? I don't know what I could be doing wrong, because it works for Android. Is there someway to view the app generation logs?

Thanks,
Diogo 

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi Diogo,

Typically, I believe that those kinds of errors are logged in the Mobile Apps logs.

I can't remember if there's another place to see that, but I'll investigate more about it.

About the behavior you described, I would bet that the problems are really related to the plugin or its implementation in Outsystems. I can try to take a look if you send it to me in a PM or so. 

But if I were you, I would review all the plugin code.


2023-05-29 08-29-44
Diogo Fonseca
Staff

Gonçalo,

I found what was the problem with the plugin. The iOS plugin installation needs some extra manual steps, for adding libraries and headers. Is there a way to do that in OutSystems?

Thanks

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi Diogo.

Nice to know that.

Both thinks can be done, but I would need more details about what do you really need to add, where and when.

You can PM me with the plugin and a sample eSpace and I can try to help you. 

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi Diogo,

After a quick analysis of the documentation, I think that the iOS implementation is going to be hard (if I got it well). 

According to it, you should add to the XCode project the mentioned headers files ( .h files inside Headers folder) and static libraries ( .a files inside Libraries folder).

So, since it's the platform that generates the builds, I don't think we're able to access them.

I'll try to get more information asap, and I'll let you know.

Cheers,

GM

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.