I have been trying to send sms from my app without user intervention programmatically however there is no success.
I have tried the intent method
var intent = Ti.Android.createIntent(
{
action: Ti.Android.ACTION_SENDTO, data: 'smsto:1234567890'
});
intent.putExtra('sms_body', 'Geolocation:'
+ ' long ' + e.coords.longitude
+ ' lat ' + e.coords.latitude);
Ti.Android.currentActivity.startActivity(intent);
});
This sends the sms as well as the message text properly. but the only problem is it need human intervention. it calls the inbuild sms functionality and we have to press the send sms button I want to automate the process.
I found this link on github Click Here
It says we can automate the process. When I try to install the module titanium shows the module installed correctly, however in the ti app editor it says ti.android.sms module not supported by titanium SDK version 3.1.2 GA .
In the build.properties file which the original developer has provided it shows his paths to sdk 3.0.0 GA. I tried to change the build.properties file and provided the paths for android, titanium and google api with the versions and then install the module but I have no success.
Related
I am using permission_handler plugin to get access of gallery and media for image upload. Issue is the permission dialog showing different
in android.xml file i have
android:name="DOR"
android:label="DOR"
and in build.gradle and I have DOR in my app name Don't know why I get this WPS Office
Click on Ctrl + shift + f(windows) or cmd + shift+f (Mac) and find WPS office. If you find it somewhere please replace it. If you don't find it and invalidate cache and restart. Run flutter clean and then build the app
I integrated react-native-push-notification with ios and android following the documentation, also some tutorials on youtube, but I have a problem, I'm not receiving any notification, even local notification, on the iOS device, but on Android, it's working well. I don't know if I need to show you the code, because is the same as in the documentation.
By the way, I'm using firebase for cloud messaging and I configured it with my p8 key.
I had the similar issue even though every related settings were turned on. Was frustrating - i used "hi security " from Google Play store which manages the notifications. After "notification" was set to ON, I found all of the badges are showing up - missed call and unread messages on both home screen and app.
I also tried with react-native-firebase but it does not work.No push notification is received . Later I Implemented push notification using react-native-fcm and it worked. You can check the link https://github.com/evollu/react-native-fcm
You are not receiving notification probably because firebase is not integrated properly in your application. The steps to integrate properly are given below:
react-native-firebase library did not work for me .Integrating firebase to react native application using react-native-fcm succeded in receiving push notifications.
1.Install react-native-fcm:
npm install react-native-fcm --save
From firebase console,
for Android: download google-services.json file and place it in android/app directory.
for iOS: download GoogleService-Info.plist file and place it in /ios/your-project-name directory (next to your Info.plist)
3.Configure the project using :
cd ios && pod init
4.Edit the newly created Podfile:
pod install
5.Edit AppDelegate.h:
#import UserNotifications;
#interface AppDelegate:UIResponder<UIApplicationDelegate,UNUserNotificationCenterDelegate>
#interface AppDelegate : UIResponder <UIApplicationDelegate>
6.Edit AppDelegate.m:
#import "RNFIRMessaging.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
return YES;
}
-(void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^) .
(UNNotificationPresentationOptions))completionHandler
{
[RNFIRMessaging willPresentNotification:notification
withCompletionHandler:completionHandler];
}
#if defined(__IPHONE_11_0)
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{
[RNFIRMessaging didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
}
#else
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void(^)())completionHandler
{
[RNFIRMessaging didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
}
#endif
//You can skip this method if you don't want to use local notification
-(void)application:(UIApplication *)application
didReceiveLocalNotification:(UILocalNotification *)notification {
[RNFIRMessaging didReceiveLocalNotification:notification];
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
fetchCompletionHandler:(nonnull void (^) .
(UIBackgroundFetchResult))completionHandler{
[RNFIRMessaging didReceiveRemoteNotification:userInfo
fetchCompletionHandler:completionHandler];
}
7.Add the path of header files into XCode:
Open XCode.
Press CMD+1 or click the XCode project.
Go to Build Settings, selecting All and Combined.
Search Header Search Path in the searchg tab.
Make sure there is a line of $(SRCROOT)/../node_modules/react-native-fcm/ios. If no, just add it.
8.Add GoogleService-Info.plist:
Make sure the file is not just moved into the folder. You need to Right Click the project folder in XCode and Add File to . Select Copy if needed in the Options page while selecting the file.
9.Shared Library Settings:
Make sure you see Pods.xcodeproj under Library folder if you are using Pod install method.
Make sure you see RNFIRMessaging.xcodeproj under Library folder.
If you don't see any of these files, please add them by Right Click the Library folder and Add File to to add them back. Pods.xcodeproj should be under ios/Pods/, and RNFIRMessaging.xcodeproj should be under node_modules/react-native-fcm/ios.
Make sure you see libRNFIRMessaging.a under Link Binary With Libraries under Build Phases tab. If no, drag the file under RNFIRMessaging.xcodeproj under Library folder into there.
10.Add Capabilities
Select your project Capabilities and enable:
Push Notifications
Background Modes > Remote notifications.
FirebaseAppDelegateProxyEnabled
This instruction assumes that you have FirebaseAppDelegateProxyEnabled=YES (default) so that Firebase will hook on push notification registration events. If you turn this flag off, you will be on your own to manage APNS tokens and link with Firebase token.
I am developing an android app based on ionic 2 using typescript.
I would like o open a PDF file inside my app with another app that is registered for the fyletype (e.g. Acrobat Reader).
Therefore i tried the two standard plugins:
https://github.com/disusered/cordova-open
https://github.com/pwlin/cordova-plugin-file-opener2
Although ive added both plugins via "ionic plugin add ..." and of course played around with several combination referencing to it
the result is always that they ere not found
cordova-open
var open = cordova.plugins.disusered.open;
Property 'disusered' does not exist on type 'CordovaPlugins'.
cordova-plugin-file-opener2
cordova.plugins.fileOpener2.open(
filePath,
fileMIMEType,
{
error : function(){ },
success : function(){ }
}
);
Property 'fileOpener2' does not exist on type 'CordovaPlugins'.
I am running the app on an emulator via ionic run android
Could you please give some hint how i can achieve to use one of these plugins?
Thank you very much
Shane
I'm using Phonegap EMailComposer plugin with Android to send a file attached but when the mail client (gmail app) opens I always get the same error "the file can't be attached'.
This is the code I'm using:
cordova.plugins.email.open({
to: 'XX',
subject: 'XX',
body: 'XX',
attachments: '//file.csv'
});
I'm quite sure the path is right becasuse when I use any other file path the error changes into "attached file can't be empty'.
I'm using cordova CLI 4.0.0 and plugin version is 0.8.2. I've tested it in Android 4.4.2 and 4.2.1
Any idea?
According to the documentation you need to use
attachments: 'file:///storage/sdcard/icon.png', //=> Android
but that didn't work for me so I tried without storage and it works for me. (I'm using Android 5.1.1 for my tests, so i don't know if it works in your case for Android 4.x)
Try with:
attachments: 'file:///sdcard/file.csv
Has anyone gotten the clipboard plugin to work with "PhoneGap Build"?
I can't get it to work. I'm currently useing phonegap 3.1.0
My app is for android and IOS. I've only tested the clipboard plugin on android so far, and it isn't working.
in my config.xml:
<gap:plugin name="com.verso.cordova.clipboard" />
in my javascript:
window.plugins.clipboard.copy('some text',function(){alert('success');},function(response){alert('error:' + response);});
window.plugins.clipboard.paste(function(text){alert('paste success:' + text);},function(response){alert('paste error:' + response);});
The way I have it above, the script runs, but for both the copy and paste calls, the error function is executed and the response is "Class not found".
I have tried the above call window.plugins.copy, cordova.plugins.copy
both of those just cause the script to abort.
phonegap is loading just fine and the deviceready function has already fired before I attempt the above calls.
Under the plugins tab on the phonegap build webpage for my app:
Installed 3rd Party Plugins
com.verso.cordova.clipboard 0.1.0
This appears to be unrelated to the copy/paste plugin. In phonegap 3.1 you have to reference all the phonegap plugins you want to use. In this case, I'm guessing you have a function that checks if the user has an internet connection? If so, you need to add to your config.xml