Comments (3)
Sure we will give a looks at the issue.
Open source team
Arcoiris Labs
On 14-May-2016, at 8:25 PM, Ion [email protected] wrote:
Please help me with the following:
I use https://build.phonegap.com to build your sampleapp. I tried to connect to tcp://test.mosquitto.org port 1883, but I received --> You got `disconnected and never succed to connect.Config.xml is:
<widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.phonegap.example" versionCode = "10" version = "1.0.0" > <name>Test</name> <platform name="android" /> <description>Test</description> <preference name="android-build-tool" value="gradle" /> <gap:plugin name="cordova-plugin-mqtt" spec="0.2.7" source="npm" />
<preference name="phonegap-version" value="cli-5.2.0" /> <preference name="orientation" value="default" /> <preference name="target-device" value="universal" /> <preference name="fullscreen" value="false" /> <preference name="webviewbounce" value="false" />
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
from cordova-plugin-mqtt.
@ionciubotaru
We looked into the issue and we found no issues with the connection part.
Our config.xml was this
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Hello World</name>
<description>
Hello World sample application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://phonegap.com">
PhoneGap Team
</author>
<content src="index.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-build-tool" value="gradle" />
<gap:plugin name="cordova-plugin-mqtt" spec="0.2.7" source="npm" />
<preference name="phonegap-version" value="cli-5.2.0" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="false" />
<icon src="icon.png" />
<platform name="android">
<icon density="ldpi" src="www/res/icon/android/drawable-ldpi-icon.png" />
<icon density="mdpi" src="www/res/icon/android/drawable-mdpi-icon.png" />
<icon density="hdpi" src="www/res/icon/android/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="www/res/icon/android/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="www/res/icon/android/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="www/res/icon/android/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="www/res/screen/android/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="www/res/screen/android/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="www/res/screen/android/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="www/res/screen/android/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="www/res/screen/android/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="www/res/screen/android/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="www/res/screen/android/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="www/res/screen/android/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="www/res/screen/android/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="www/res/screen/android/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="www/res/screen/android/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="www/res/screen/android/drawable-port-xxxhdpi-screen.png" />
</platform>
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
And our connection configuration was this
cordova.plugins.CordovaMqTTPlugin.connect({
url:"tcp://test.mosquitto.org", //a public broker used for testing purposes only. Try using a self hosted broker for production.
port:1883,
clientId:"arcoirislabs",
connectionTimeout:3000,
willTopicConfig:{
qos:0,
retain:true,
topic:"<will topic>",
payload:"<will topic message>"
},
keepAlive:60,
success:function(s){
console.log("connect success");
},
error:function(e){
console.log("connect error");
},
onConnectionLost:function (){
console.log("disconnect");
}
})
And it worked perfectly fine. If you need we can provide you the APK.
from cordova-plugin-mqtt.
@ionciubotaru
We tried to recreate the issue and it seems that either you used credentials for a public broker or the client ID's length exceed the 24 chars length limit.
If you still got any issues, do let us know.
We will be glad to help you.
Open Source Team
Arcoiris Labs
from cordova-plugin-mqtt.
Related Issues (20)
- clean session flag support? HOT 1
- Subscribe to multiple topics. HOT 1
- Any news about SSL support mqtts? HOT 4
- Stop Listen (Un-Listen) to a topic without disconnect
- I need help, I don't know how to make it work HOT 5
- How to subscribe multiple topics ? HOT 4
- Raspberry Pi Broker
- MQTT serverConnection lost HOT 8
- I have a probelm MQTT Plugin is not working HOT 1
- Major updates Feb 2019 HOT 2
- Background Instance
- It star give error on visual studio
- Intent Service
- Publish function sometimes retain false, sometimes true HOT 2
- Can't open mqtt reconnect function
- 无法上传数据流报文 Unable to upload data stream message
- Ionic 4- Use Cordova-plugin-mqtt HOT 1
- SSL/TLS
- paho not defined HOT 2
- Client ID register as "null" by broker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-mqtt.