Coder Social home page Coder Social logo

jefflinwood / twilio_client_phonegap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stevegraham/twilio_client_phonegap

59.0 10.0 53.0 5.02 MB

Phonegap plugins for the Twilio Client iOS and Android SDKs

License: MIT License

Java 53.82% Objective-C 32.05% JavaScript 14.13%

twilio_client_phonegap's Introduction

Twilio Client Phonegap plugins for iOS and Android (version 1.1.1)

These are Phonegap plugins that expose the same JS API as Twilio Client for web as much as possible, meaning you should be able to use the same Twilio Client code from your web application inside of your Phonegap application with few if any modifications.

Latest versions tested with this plugin

(as of July 14, 2017)

  • Cordova 7.0.1
  • Cordova Android 5.2.1
  • Cordova iOS 4.3.1
  • Twilio Client for iOS 1.2.7
  • Twilio Client for Android 1.2.17
  • XCode 8.3
  • Android SDK 23

Android Gradle Support

  • Version 1.0.6 and above now downloads the latest version of the Twilio SDK from jcenter - you will need to use the Cordova Android plugin 5.2.1 for this, as the version of Gradle needed is 2.1.3, and 5.2.1 also includes jcenter as a default repository.

Android Support Library

  • Versions 1.0.4 and earlier of the plugin required you to include the Android support library v4 in the lib. Cordova now has a solution for requiring Android libs through Gradle dependencies. This will save you a step on installation, as well as making this plugin (as of versin 1.0.5) compatible with other plugins such as the PhoneGap Push plugin. One handy tip I found on that plugin is that you may need to update your Android support library using this command line tool, if you get an error saying that the Android Support v4 library can not be found:

android update sdk --no-ui --filter "extra"

Please file an issue if you have problems with the Android support library or any compatibility issues with other plugins.

Example application

https://github.com/jefflinwood/TwilioClientPhoneGapExampleApp

PhoneGap/Cordova Overview

Installation Instructions

cordova plugin add twilio-client-phonegap-plugin

Additional Features

In addition to the standard features of the Twilio Client JS Library, you can also use the included showNotification and cancelNotification functions to display a UILocalNotifcation to the user when during an incoming call while the app is running in the background:

Twilio.Connection.showNotification("Notification Text", "notification_sound.wav");
Twilio.Connection.cancelNotification();

You can also turn the device's speaker phone on or off during a call using the following method:

Twilio.Connection.setSpeaker("on");

Changelog

  • 1.1.1 - Fixed Twilio Connection disconnect argument in Javascript file.
  • 1.1.0 - Utilize Cocoapods framework support for iOS
  • 1.0.7 - Added Marshmallow/SDK 23 support for runtime permissions
  • 1.0.6 - Updated Android platform for plugin to pull in Twilio Android SDK using Gradle

Limitations

The current version of the Twilio Client SDK requires iOS 8.1, but the Cocoapods support in Cordova iOS is hardcoded to iOS 8.0. Will need to get this addressed in the cordova-ios project.

This is plugin is a first cut and should be considered alpha. Please use it and break it :) Report any issues using the Github issue tracker.

Some of the event handlers are currently no-ops because of differences between the web SDK and the iOS SDK, i.e. they both expose events the other does not, e.g. Twilio.Device.cancel is a no-op and there is no JS SDK notion of -(void)deviceDidStartListeningForIncomingConnections:(TCDevice*)device, etc.

Twilio.Connection objects are just proxy objects that delegate to the Objective-C layer.

Sounds are currently disabled and the JS methods that control them are no-ops because enabling them causes EXC_BAD_ACCESS errors. Will fix.

Methods that interrogate the client device or connection and return a result e.g. Twilio.Device.status() take a callback function with the response as the argument. Unfortunately I think this is unavoidable due to communication between the Phonegap JS and iOS layers being strictly asynchronous, e.g.

Twilio.Device.connect(function(connection) {
    alert(connection.status());
})

becomes:

Twilio.Device.connect(function(connection) {
    connection.status(function(status) { alert(status) });
})

Twilio Client documentation: http://www.twilio.com/docs/client/twilio-js

twilio_client_phonegap's People

Contributors

jefflinwood avatar lylepratt avatar marcopadillo avatar peder541 avatar romainpellerin avatar stevegraham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twilio_client_phonegap's Issues

openssl crash

I have been struggling with this for days. Using cordova 4.3.0.
After calling Twilio.Device.setup I get and exception in objective-c : EXC_BAD_ACCESS.

screen shot 2015-06-23 at 4 23 20 pm

As you can see the problem is when using openssl library.
What would have causing this issue ?

Uncaught ReferenceError: Twilio is not defined

Hi all,
I am developing phonegap app with twilio for android. When i run the app in device, When calling Twilio.Device.setup i get this error in Android Device Monitor :

" Uncaught ReferenceError: Twilio is not defined"

I guess the plugin file tcPlugin.js is not linked to app. Dont know why.
Added script type="text/javascript" src="js/tcPlugin.js to index.html. but same error.
Do i have to add the twilio.min.js in index.html ?

Am i missing anything ?

UPDATE:
I ran Cordova.exec(function(callback){alert('success');}, function(callback){console.log(callback);}, "TCPlugin", "deviceSetup", [token]);

Result : Class not found:202

Can't get Example App to work - new error with AudioSession

Hi,

I've downloaded your example app and created a token server per Twilio tutorial instructions. However, when I hit "dial", I get the following errors in the console:

2015-06-21 17:58:39.976 TwilioApp[535:62405] 17:58:39.976 ERROR: [0x1055fc000] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
2015-06-21 17:58:39.977 TwilioApp[535:62405] 17:58:39.976 ERROR: [0x1055fc000] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'

Anyone experiencing this problem?

Twilio Connection object parameters

Hi Jeff.

First of all I would like to say this is a great project.
It's already save me loads of time, and probably a great many head aches to come.

I am currently trying to receive calls from Twilio on my phonegap project.
And according to https://www.twilio.com/docs/client/connection#parameters, the connection object should contain both status and parameters.

I can see the status value just fine.
However, attempting to access the parameters field, I am getting a undefined response.
Is this a factor of the phonegap plugin that hasn't been implemented?
Or might I be doing something commonly wrong?

This is the pertinent part of the code

Twilio.Device.incoming(function(conn) {
   conn.status(function(status) { alert(status) });
   alert(conn.parameters);
   alert(conn.parameters.From);
   alert(conn.parameters.To);
   ...

Receive call works only on first run

Hello,

I'm having a strange problem when using the library, everything works correctly the first time you run the application, after that, only back to receive calls if I clear the application data on the settings menu.

On the second run, the app receive the Twilio.ready() but dont receive the incoming, i tested on an Android Phone 5.0 (lollipop) and an Android Tablet 4.2.2 (Jelly Bean)

Someone also had or are having this problem?

Here is a sample code:

<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <meta http-equiv="cache-control" content="max-age=0" />
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="expires" content="0" />
        <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
        <meta http-equiv="pragma" content="no-cache" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <title>Hello World</title>
    </head>
    <body>

        <div id="teste">
            <div id="message"></div>
            <input type="button" id="btAtender" value="Atender" style="display:none">
            <input type="button" id="btDesligar" value="Desligar" style="display:none">
            <input type="button" id="btDesconectar" value="Desconectar" style="display: none">
        </div>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript" src="js/tcPlugin.js"></script>
        <script type="text/javascript">
        var message = $("#message");

        $("#btDesligar").click(function () {
            Twilio.Device.disconnectAll();
        });
        $("#btDesconectar").click(function () {
            Twilio.Connection.disconnect();
        });
        function deviceReady() {
            window.localStorage.clear();
            navigator.app.clearCache();
            $.ajax(
                {
                    url: "{URL_TO_GET_TOKEN}", 
                    success: function(token){
                        console.log(token);
                        Twilio.Device.setup(token);

                        Twilio.Connection.setSpeaker("on");

                        Twilio.Device.ready(function() {
                            console.log("Twilio ready");
                            message.html("Twilio ready");
                            // Could be called multiple times if network drops and comes back.
                            // When the TOKEN allows incoming connections, this is called when
                            // the incoming channel is open.
                        });

                        Twilio.Device.offline(function() {
                            console.log("Twilio offline");
                            message.html("Offline");
                            // Called on network connection lost.
                        });

                        Twilio.Device.incoming(function(conn) {
                            console.log("Incoming");
                            message.html("Recebendo ligação");
                            $("#btAtender").show();
                            $("#btAtender").click(function () {
                                conn.accept();
                                $("#btAtender").hide();
                                $("#btDesligar").show();

                                message.html("Em ligação");

                            });
                            // conn.status // => "connecting"
                        });

                        Twilio.Device.cancel(function(conn) {
                            console.log("Cancel");
                            console.log(conn.parameters.From); // who canceled the call
                            conn.status // => "closed"
                        });

                        Twilio.Device.connect(function (conn) {
                            console.log("Connect");
                            // Called for all new connections
                            console.log(conn.status);
                        });

                        Twilio.Device.disconnect(function (conn) {
                            //Twilio.Connection.disconnect();
                            console.log("Disconnected");
                            message.html("Desconectado");
                            $("#btAtender").hide();
                            $("#btDesligar").hide();

                            // $("#btReiniciar").show();
                        });

                        Twilio.Device.presence(function (presenceEvent) {
                            console.log("Presence")
                            // Called for each available client when this device becomes ready
                            // and every time another client's availability changes.
                            presenceEvent.from // => name of client whose availability changed
                            presenceEvent.available // => true or false
                        });

                        Twilio.Device.error(function (e) {
                            console.log(e.message + " for " + e.connection);
                        });
                    }
                }
            );
            message.html("Starting twilio setup");
        }
        </script>
    </body>
</html>

Crashing on incoming call

I successefully installed the Twilio client phonegap.
I can do call but It crash on incoming call in Android Studio and in the app on Android.

I checked the log, and when it crash i have no message.

Also, status message update on call and on end call but not on ready.

js file error. Android

05-01 07:39:13.498: D/CordovaLog(1630): file:///android_asset/www/js/tcPlugin.js: Line 15 : Uncaught TypeError: Cannot read property 'prototype' of undefined

Can't hear the sound transmission on Android 6

I tested it on two devices with Android version 6.
Also, same code works for Android 5 and Android 4.

My use case:

  1. Someone calls the phone number that assigned with Twilio
  2. URL on Twilio provides the TwiML that opens the conference with unique room name
  3. The server code with TwiML URL initiates the outgoing call to Ionic app
  4. Ionic app on Android handles the incoming call from conference
  5. User of Ionic app answer the call

Calling the Divice.disconnect() function

Hi Jeff.
Sorry. I have another issue again.

I am trying to hangup on a incoming call to the client, by calling disconnect() on the connection.
However, the call proceeds to continue ignoring the function call.
The .accept() call works absolutely fine though. As does the disconnectAll() call to end the connection.

I tried looking into it myself. And I found something to didn't seem quite right to me.
It's https://github.com/jefflinwood/twilio_client_phonegap/blob/master/www/tcPlugin.js#L110-L116
It looks like fn is passed into the disconnect function, but it isn't used. Instead, the function refers to an argument.

I tried changing that myself with no success. So I wondering if something else is causing my problems.

Plugman not installing plugin successfully for Android

Not sure if I am doing something wrong, but after running plugman as per the instructions, this section of res/xml/config.xml does not get updated, I had to add it in manually.

<feature name="TCPlugin">
    <param name="android-package" value="com.phonegap.plugins.twilioclient.TCPlugin"/>
</feature>

Parameters from connection not working

Hello,

I'm having a problem with retrieving the connection parameters from an incoming connection.

when executed on android 5.0 (lollipop) in the following code the 'From' is undefined.

Twilio.Device.incoming(function(conn) {
    console.log('From ' + conn.parameters.To);
}

Does someone else also have this problem?

Incoming calls don't get status callbacks

I noticed that incoming calls don't get status callbacks, mainly disconnect.

I fixed it by setting the delegate on an incoming connection here:

-(void)device:(TCDevice *)device didReceiveIncomingConnection:(TCConnection *)connection {
self.connection = connection;
self.connection.delegate = self;
[self javascriptCallback:@"onincoming"];
}

Connection Status

Hi,

I am using this plugin and it work great, however I cannot figure it out how to get the connection status on status change.

Any help will be appreciated.

-all_load giving Apple Mach-O Linker Error

Hello friends,
I am stuck at this from 2 days. I installed the plugin to a fresh phonegap app. Copied the headers, library file to xcode project from twilio ios sdk and added "-ObjC" and "-all_load" in linker as mentioned after plugin installation. When i run i get the 5 deprecations warning in TCPlugin.m file. And get 1 Apple Mach-O Linker Error : ld: 38 duplicate symbols for architecture x86_64 in libTwilioClient.a file.

Build fails and so could the load the app in ios simulator. If i skip adding -all_load, build gets successful but then Twilio doesnt works.
Twilio.Device.ready doesnt runs. Instead Twilio.Device.offline is called.

Using: Xcode v 6.1.1
Base SDK : iOS 8.1
Deployment Target: 6.0
If you need any more info please feel free to ask.
Please suggest me if i am doing anything wrong.
It would be great if someone can help me to go through this.
Regards,
Jiju

console.log(Twilio.Device.status()) returns undefined

Hi,
After device is ready, when i do console.log(Twilio.Device.status()) it returns undefined.

Is there is any change in syntax?

Also, after closing the app, when i reopen the app it does not run Twilio.Device.ready function.
Please help me with the queries. Thanks.

Telerik Platform Support

I'm creating a phonegap/cordova app using the Telerik Platform. I have it compiling using their build server. (I'm not doing my own builds with Xcode or similar). I have a server to retrieve the token. That's all working fine.

Whenever I run Twilio.Device.setup(token) the app starts. I can't get any error messages out of it or anything. The javascript function executing that command stops executing after that line. I've tried modifying tcPlugin.js like this:

TwilioPlugin.Device.prototype.setup = function (token) {
// Take a token and instantiate a new device object
var error = function (error) {
if (delegate['ondeviceerror']) delegate'ondeviceerror'
if (delegate['onconnectionerror']) delegate'onconnectionerror'
alert(error);
}

    var success = function (callback) {
        var argument = callback['arguments'] || new TwilioPlugin.Connection();
        if (delegate[callback['callback']]) delegate[callback['callback']](argument);
    }

    Cordova.exec(success, error, "TCPlugin", "deviceSetup", [token]);
}

Still nothing coming back. Any ideas to help me troubleshoot this error?

android twilio native error

05-02 02:14:09.123: E/AndroidRuntime(1135): FATAL EXCEPTION: main
05-02 02:14:09.123: E/AndroidRuntime(1135): Process: com.phonegap.helloworld, PID: 1135
05-02 02:14:09.123: E/AndroidRuntime(1135): java.lang.UnsatisfiedLinkError: Couldn't load twilio-native from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.phonegap.helloworld-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.phonegap.helloworld-2, /system/lib]]]: findLibrary returned null
05-02 02:14:09.123: E/AndroidRuntime(1135): at java.lang.Runtime.loadLibrary(Runtime.java:358)
05-02 02:14:09.123: E/AndroidRuntime(1135): at java.lang.System.loadLibrary(System.java:526)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.twilio.client.impl.useragent.UserAgent.(UserAgent.java:16)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.twilio.client.impl.CallControlManager.initialize(CallControlManager.java:179)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.twilio.client.impl.CallControlManager.getInstance(CallControlManager.java:117)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.twilio.client.impl.TwilioClientServiceImpl.initialize(TwilioClientServiceImpl.java:168)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.twilio.client.TwilioClientService.onCreate(TwilioClientService.java:47)
05-02 02:14:09.123: E/AndroidRuntime(1135): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2572)
05-02 02:14:09.123: E/AndroidRuntime(1135): at android.app.ActivityThread.access$1800(ActivityThread.java:135)
05-02 02:14:09.123: E/AndroidRuntime(1135): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
05-02 02:14:09.123: E/AndroidRuntime(1135): at android.os.Handler.dispatchMessage(Handler.java:102)
05-02 02:14:09.123: E/AndroidRuntime(1135): at android.os.Looper.loop(Looper.java:136)
05-02 02:14:09.123: E/AndroidRuntime(1135): at android.app.ActivityThread.main(ActivityThread.java:5017)
05-02 02:14:09.123: E/AndroidRuntime(1135): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 02:14:09.123: E/AndroidRuntime(1135): at java.lang.reflect.Method.invoke(Method.java:515)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-02 02:14:09.123: E/AndroidRuntime(1135): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-02 02:14:09.123: E/AndroidRuntime(1135): at dalvik.system.NativeStart.main(Native Method)

AVAudioSessionUtilities

When I try to call in iOS I get 2 errors:
GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
Is it similar with plugin code in iOS? Cant find any.

Twilio.Device.disconnectAll();

Hello, firt of all thanks for this great plugin! keep up the good work.

at the begining i used the plugin without any issue, but now i have encuonterd some, the most urgunt one is that i can terminate a connection.
when i call Twilio.Device.disconnectAll() nothing appear to happen and the connection stays alive.

i have noticed twilio has updated thier javascript sdk, when i use 1.1(<script src="http://static.twilio.com/libs/twiliojs/1.1/twilio.min.js"></script>)
the plugin works with the issues i mention, but when im using 1.2 there are much more crashes on random calls to Twilio.Device.

the other issues i have experienced:
-when runing on actual android device the plugin works, but when i try to run it on genymotion it crashes on any first call to Twilio.
-i can instasiate as meny connection i want simultaniusly, it that a regular behavior? i can progrematicly avoid it but the Twilio.Device.status() dosent allways works and i havnt findout when and why.

Thanks again! ask me anything to dig further.

Background Incoming call usage (Android)

The twilio android SDK docs says :

"Incoming calls are first detected by the Twilio Client service, which then hands them to your app to handle. However, your application may be in the background and its Activities paused or killed, so the library needs a mechanism to ensure your app gets restarted properly and hand it the incoming call. In fact, the same mechanism is used to notify your app about incoming calls when it's in the foreground."

My question is, how do I receive incoming calls while the app is killed / paused?

Starting Hello Monkey Application

Hello everybody.
I hope somebody can help me to solve my issues. Ive added the twilio plugin to my cordova ios project. Worked well. Ive added the header und lib files. But from now on i dont know how to start the whole thing. Ive tried the "Hello Monkey" example from the Twilio docs but it does not work on my App.
Can somebody show me what i am doing wrong? For the token i uploaded the php files from twilio to my ftp and generated there my token with my account details. Then i put the token into my app and tried it, but it dont work on simulator and iphone device.

Its just the Test Call to see if everything works.
Here is my code, just the index.html

   <html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello World</title>




    </head>
    <body>
      <script type="text/javascript" src="cordova.js"></script>
      <script type="text/javascript" src="js/index.js"></script>
      <script type="text/javascript" src="js/tcPlugin.js"></script>



<script type="text/javascript">

    Twilio.Device.setup("HERE IS MY TOKEN");

    Twilio.Device.ready(function (device) {
                        $("#log").text("Ready");
                        });

                        Twilio.Device.error(function (error) {
                                            $("#log").text("Error: " + error.
                                                           message);
                                            });

                                            Twilio.Device.connect(function (conn) {
                                                                  $("#log").text("Successfully established call");
                                                                  });

                                                                  function call() {
                                                                      Twilio.Device.connect();
                                                                  }
</script>
</head>
<body>
    <button class="call" onclick="call();">
        Call
    </button>

    <div id="log">Loading pigeons...</div>
</body>
</html>


      ```















Releasing device not working properly

Hello,

I seem to have some problems releasing the device.
I'm using following code:

Twilio.Device.setup("");

But when I setup a new device and I receive a call the incoming event is still called twice.

Anyone knows how to solve this issue?

Android: Start Service on Boot

In order for the app to receive phone calls (on Android) after the phone is restarted, we need to start the VOIP service on Boot - this will require some additions for the plugin installation, but not for the Javascript.

Hearing echo on both iOS 7 and iOS 8 devices

Hi, we implemented the plugin in our phonegap app. We are able to successfully connect the two endpoints but hear a lot of echo on iphone. Android works just fine. Appreciate any insights

Thanks

java.lang.UnsatisfiedLinkError

App crash on Samsung Galaxy S6 and on phones with 64 bit architecture

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.spoof.call.international-1/base.apk"],nativeLibraryDirectories=[/data/app/com.spoof.call.international-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libtwilio-native.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at com.twilio.client.impl.useragent.UserAgent.(UserAgent.java:16)
at com.twilio.client.impl.CallControlManager.initialize(CallControlManager.java:189)
at com.twilio.client.impl.CallControlManager.getInstance(CallControlManager.java:131)
at com.twilio.client.impl.TwilioClientServiceImpl.initialize(TwilioClientServiceImpl.java:169)
at com.twilio.client.TwilioClientService.onCreate(TwilioClientService.java:50)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3286)
at android.app.ActivityThread.access$1900(ActivityThread.java:182)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1558)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6141)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

SDK crashes on incoming calls for Android

When I recieve an incoming call, the app crashes, I get the following:

E/Parcel  (  953): Class not found when unmarshalling: com.twilio.client.impl.InternalConnectionImpl
E/Parcel  (  953): java.lang.ClassNotFoundException: com.twilio.client.impl.InternalConnectionImpl
E/Parcel  (  953):  at java.lang.Class.classForName(Native Method)
E/Parcel  (  953):  at java.lang.Class.forName(Class.java:251)
E/Parcel  (  953):  at java.lang.Class.forName(Class.java:216)
E/Parcel  (  953):  at android.os.Parcel.readParcelableCreator(Parcel.java:2133)
E/Parcel  (  953):  at android.os.Parcel.readParcelable(Parcel.java:2097)
E/Parcel  (  953):  at android.os.Parcel.readValue(Parcel.java:2013)
E/Parcel  (  953):  at android.os.Parcel.readArrayMapInternal(Parcel.java:2314)
E/Parcel  (  953):  at android.os.Bundle.unparcel(Bundle.java:249)
E/Parcel  (  953):  at android.os.Bundle.getString(Bundle.java:1118)
E/Parcel  (  953):  at android.content.Intent.getStringExtra(Intent.java:5285)
E/Parcel  (  953):  at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1586)
E/Parcel  (  953):  at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1167)
E/Parcel  (  953):  at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:4786)
E/Parcel  (  953):  at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254)
E/Parcel  (  953):  at com.android.server.am.PendingIntentRecord.send(PendingIntentRecord.java:194)
E/Parcel  (  953):  at android.content.IIntentSender$Stub.onTransact(IIntentSender.java:64)
E/Parcel  (  953):  at android.os.Binder.execTransact(Binder.java:404)
E/Parcel  (  953):  at dalvik.system.NativeStart.run(Native Method)
E/Parcel  (  953): Caused by: java.lang.NoClassDefFoundError: com/twilio/client/impl/InternalConnectionImpl
E/Parcel  (  953):  ... 18 more
E/Parcel  (  953): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.twilio.client.impl.InternalConnectionImpl" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
E/Parcel  (  953):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/Parcel  (  953):  at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/Parcel  (  953):  at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/Parcel  (  953):  ... 18 more
W/MessageQueue( 1262): Handler (android.media.MediaPlayer$EventHandler) {44313280} sending message to a Handler on a dead thread
W/MessageQueue( 1262): java.lang.RuntimeException: Handler (android.media.MediaPlayer$EventHandler) {44313280} sending message to a Handler on a dead thread
W/MessageQueue( 1262):  at android.os.MessageQueue.enqueueMessage(MessageQueue.java:320)
W/MessageQueue( 1262):  at android.os.Handler.enqueueMessage(Handler.java:626)
W/MessageQueue( 1262):  at android.os.Handler.sendMessageAtTime(Handler.java:595)
W/MessageQueue( 1262):  at android.os.Handler.sendMessageDelayed(Handler.java:566)
W/MessageQueue( 1262):  at android.os.Handler.sendMessage(Handler.java:503)
W/MessageQueue( 1262):  at android.media.MediaPlayer.postEventFromNative(MediaPlayer.java:3407)
W/MessageQueue( 1262):  at dalvik.system.NativeStart.run(Native Method)
V/MediaPlayer( 1262): back from callback

Plugin doesn't work with Cordova3.x

Hey Jeff,

The plugin doesn't work in more recent versions of Cordova(3.x). Mainly due to the change in plugin signatures. Any chance you update the plugin :)

Thanks
Asvin

Twilio device status offline

Hello!
I have been struggling with this since the beggining. I am developing an app with ionic + phonegap + twilio for ios and android. For iOS everything works perfect. Unfortunately it is not the case for Android.
The main issue is as the title says, for every token I try to setup twilio, I always receive status offline.

https://github.com/fedxgibson/toptierlabs-app

Here is an example app.

require 'twilio-ruby'

account_sid = 'a'
auth_token = 'b'
appSid = 'c'
capability = Twilio::Util::Capability.new account_sid, auth_token
capability.allow_client_outgoing(appSid);
capability.generate

And this is how I generate token.
I would appreciate a lot your help. I know it is not precisely the plugin problem ( althought it could be, eventually ), but I dont know who else could help me.
Thanks in advance

Notification Error.

05-03 10:09:41.911: E/NotificationService(384): Not posting notification with icon==0: Notification(pri=0 contentView=com.phonegap.helloworld/0x1090064 vibrate=null sound=null defaults=0x0 flags=0x0 kind=[null])
05-03 10:09:41.911: E/NotificationService(384): WARNING: In a future release this will crash the app: com.phonegap.helloworld

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.