It is working fine in most of the devices but samsung tab.
Can someone please suggest me which plugin is to be used?
- 12 Posts
- 0 Reply Likes
Posted 4 years ago
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 12 Posts
- 0 Reply Likes
I am using plugin com.cordova.plugins.sms
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 12 Posts
- 0 Reply Likes
gap:plugin name="com.cordova.plugins.sms" spec="0.1.2" source="pgb"
Now i have updated
gap:plugin name="cordova-plugin-sms" source="npm"
As suggested below url
cordova-plugin-sms
After updating code showing error sms not defined
I had tried to solve this using below url but not succeed
Tried solutions
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
The problem is that you need to make sure that you set the target to android-19 or later
Did you?
- 12 Posts
- 0 Reply Likes
- 12 Posts
- 0 Reply Likes
Please send me code.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
http://docs.build.phonegap.com/en_US/...
- 12 Posts
- 0 Reply Likes
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.test.pdc" version="1.7.2" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Collection</name>
<description>Application</description>
<author email="" href="">Test</author>
<content src="index.html" />
<preference name='phonegap-version' value='cli-5.1.1' />
<preference name="android-build-tool" value="gradle" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-installLocation" value="auto" />
<preference name="SplashScreenDelay" value="5000" />
<gap:plugin name="org.apache.cordova.battery-status" source="npm"/>
<gap:plugin name="org.apache.cordova.camera" source="npm"/>
<gap:plugin name="org.apache.cordova.media-capture" source="npm"/>
<gap:plugin name="org.apache.cordova.console" source="npm"/>
<gap:plugin name="org.apache.cordova.contacts" source="npm"/>
<gap:plugin name="org.apache.cordova.device" source="npm"/>
<gap:plugin name="org.apache.cordova.device-motion" source="npm"/>
<gap:plugin name="org.apache.cordova.device-orientation" source="npm"/>
<gap:plugin name="org.apache.cordova.dialogs" source="npm"/>
<gap:plugin name="org.apache.cordova.file" source="npm"/>
<gap:plugin name="org.apache.cordova.file-transfer" source="npm"/>
<gap:plugin name="org.apache.cordova.geolocation" source="npm"/>
<gap:plugin name="org.apache.cordova.globalization" source="npm"/>
<gap:plugin name="org.apache.cordova.inappbrowser" source="npm"/>
<gap:plugin name="org.apache.cordova.media" source="npm"/>
<gap:plugin name="org.apache.cordova.network-information" source="npm"/>
<gap:plugin name="org.apache.cordova.splashscreen" source="npm"/>
<gap:plugin name="org.apache.cordova.vibration" source="npm"/>
<gap:plugin name="de.appplant.cordova.plugin.email-composer" version="0.8.0" />
<gap:plugin name="cordova-plugin-sms" source="npm" />
<icon src="icon.png" />
<icon gap:platform="android" gap:qualifier="ldpi" src="res/icon/android/icon-36-ldpi.png" />
<icon gap:platform="android" gap:qualifier="mdpi" src="res/icon/android/icon-48-mdpi.png" />
<icon gap:platform="android" gap:qualifier="hdpi" src="res/icon/android/icon-72-hdpi.png" />
<icon gap:platform="android" gap:qualifier="xhdpi" src="res/icon/android/icon-96-xhdpi.png" />
<gap:splash src="splash.png" />
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" />
<access origin="*" />
<plugin name="cordova-plugin-whitelist" version="1" />
<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>
</widget>
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
Since this appears to be your first posting, please answer the following questions.
- is this your first hybrid mobile app?
- are you using phonegap desktop app?
- Are you using CLI, Build or SDK? Please do not assume the answer. Please read the link.
Thanks
Jesse
- 12 Posts
- 0 Reply Likes
- are you using phonegap desktop app? - No
- Are you using CLI, Build or SDK? Please do not assume the answer. Please read the link. - Build
- 12 Posts
- 0 Reply Likes
Can anyone please provide solution?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
<plugin name="cordova-plugin-whitelist" version="1" />
That version doesn't exist at npm. Remove the version attribute.
2. You have this
<allow-intent href="sms:*" />
Why did you include that?
3. You are using all old, deprecated plugins, or at least their names.
Be aware that the plugins at npm are named differently (usually something like 'cordova-plugin-....', but not always). Find the correct names and replace.
4. On your test in Tab3/Tab4: do you receive any error messages? If not, which part of your code is executed, and where does it fail?
- 12 Posts
- 0 Reply Likes
I have found it's break due to FEATURE_TELEPHONY not supported on these devices.
ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)
Can you please suggest me any other plugin, which doesn't use FEATURE_TELEPHONY ** feature.
Thanks
Ankit
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 12 Posts
- 0 Reply Likes
I am not using any third party api.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 12 Posts
- 0 Reply Likes
The point here is that the plugin for SMS checks for FEATURE_TELEPHONY feature and Samsung tabs somehow gives false for this even when they have the features of phone.
So we need a plugin that doesn't check for this feature.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
http://cordova.apache.org/plugins/?q=sms
- 12 Posts
- 0 Reply Likes
I have tried all plugins.
My requirement is SMS send in background, It's should not open Native SMS app.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
That would enable you to send the data from your app per Ajax/XHR to the server and send the SMS from there. Such option would also enable tablets without SIM card to send SMS. And of course, the native SMS app is not activated.
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
I'm on a desktop for the next few evenings.
I need to get some talks done. and some blog posts done.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Meanwhile, I will try and save the World all by myself. A terrible job, but someone has to do it.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Meanwhile, you have ignored a couple of steps from this thread:
- set targetSDK to 19 or higher
- why is an intent rule for 'sms:*' included?
Finally another suggestion: since you found the statement in the plugin's source, which causes the issue, you could consider forking the plugin, removing the statement and uploading it as a separate plugin.
JesseMonroy650 (Volunteer), Champion
- 3325 Posts
- 122 Reply Likes
The following example code works for SMS. I did not test for background operations. if you are using Android 6.x, you may need an exception.
CODE: https://github.com/jessemonroy650/3rdParty-send-SMS-Example
Android 6 and Doze
I will return in 24 hours.
Best of Luck
Jesse
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers
-
Plugins
- 1283 Conversations
- 38 Followers


