Read all the messages in inbox - android

I am new to react-native.I am trying to build a simple android application that reads all the messages from the inbox and display it in a listview. In android,i can read all the messages using URI.
How can i read all the messages in a similar way using react-native?
Thanks in advance

In React native,you want to read sms from android phone:
react-native-get-sms-android
This module that supports interaction with the Messaging API on Android
The package allows you to:
• get messages
• send messages
• delete messages
Refer this for this module integration:react-native-get-sms-android
Make sure that you need specific permissions to read SMS for android.
For checking permissions in android,use PermissionsAndroid API.It provides access to Android M's new permissions model.For more details check this docs
react-native-android-sms-listener
To listen for the new messages in your app use this library.This library allows you to listen for incoming SMS messages.
Refer this for this module integration:react-native-android-sms-listener

Remember that everything that you did in Android, you can still do it in react Native, writing a Native Module, and here is a well explained example of how to do that https://facebook.github.io/react-native/docs/native-modules-android
Or I saw that there is this external library https://github.com/briankabiro/react-native-get-sms-android, that you might try.

Related

About FCM Multi-Subscription(Android)

I.m going to make the new Android app using Firebase Cloud Message (topic system).
-Can I use Multi-subscribe systems(ex.topic1, topic2) in the android app?
-Can I see an example?
Does not matter Java or kotlin

Push notification from Mixpanel dashboard to Android Cordova app

I am successfully sending Push Notifications from the Mixpanel Dashboard to a Cordova app on both iOS and Android devices, using phonegap-plugin-push.
However, the title and body values entered in the default fields only appear on iOS devices.
For the notification to appear on Android devices, I currently need to include a custom payload in Mixpanels "Custom Data":
{
"title":"Title for Android only",
"body":"Content for Android only"
}
This is an error prone step for any non-technical using Mixpanel to send notifications.
Does someone know an easier way to do this?
The short answer here is that Cordova/Phonegap and similar third party frameworks are not 100% optimized for Mixpanel functionality (although they work pretty great), and as such you'll need to generate separate push notifications for both iOS and Android in your Mixpanel project.
Providing context, all iOS pushes regardless of app deliver a JSON payload to APN using the same keys to deliver their messages (alert, badge, sound). However, the keys that Android apps process for incoming GCM pushes are entirely dependent on how the GCM receiver is established, and therein lies the problem here.
Mixpanel's Android SDK initializes pushes and uses a GCM receiver that is specific to Mixpanel messages, and fully expects its custom keys (mp_message, mp_title) in order to render the notification. The webapp reformats the message input to meet these key requirements (http://bit.ly/1OGgU1y)
However, the Phonegap GCM receiver expects different keys as you've noticed. I'd recommend referring to the phonegap github page in order to get more context into the expected push format and behavior (looks like they expect "title" and "message" as the keys): http://bit.ly/1KDScye
Unfortunately, what this means is that the Android app is not optimized to receive the default, web-app generated Mixpanel pushes, although your iOS one is. Mixpanel's SDKs are intended to maximize capabilities for that platform, and it isn't guaranteed that Cordova or similar JS frameworks will translate 100%.
So to conclude - Creating a message in the Mixpanel push editor will send to iOS, but for Android you'll need to use the custom JSON payload in a separate notification, including keys that the phonegap GCM receiver is compatible with.
If its help to anyone this is how I solved the problem
in phonegap-plugin-push
you need to modify two files
GCMIntentService.java
private String normalizeKey(String key) {
if (key.equals(BODY) || key.equals(ALERT) || key.equals(MP_MESSAGE) || key.equals(GCM_NOTIFICATION_BODY)) { // added MP_MESSAGE
PushConstants.java
public static final String MP_MESSAGE = "mp_message";

How can we get same channelID at all installation in UAPush plugin + phonegap

I need channel-ID to send push notification by PhoneGap plugin in Android/iOS. I'm able to get channel-id same in iOS but Android gives different Channel-Id at all re-installation. I need same Channel-Id at all- reinstallation. Please help me if any one implemented it. Thanks a-lot.
I have google but i got that , on each installation , app creates new channel ID. Please follow given link.
http://docs.urbanairship.com/platform/android.html
So, If we want to save and access first created channel-ID over re-installation, we should use permanent storage to store first generated channel-ID and access it at all installation.

How to add androidprovider.telephony.mms to my package

I have downloaded source code for mms application from android.git.kernal.org site.But It showing errors for some of the packages missing like androidprovider.telephony.mms.
How to add androidprovider.telephony.mms to my application..?or can any one suggest a better approach for sending mms without using native intents and httppost method
(How to send image via MMS in Android?).
How to add androidprovider.telephony.mms to my application
You don't. The MMS application can only be built as part of a full firmware build.

Android read SMS history

I found a way to read the call log, e.g. incoming call, phone number, duration, etc. Now I am looking for something similar for SMS. How can I read that history for SMS? I don't need the content of the SMS only the date and the target phone number. Any idea?
Thanks,
A.
There is no API for "SMS history" in the Android SDK, sorry.
I have an open source Cordova 2.2.0 example app showing use of a Cordova plug-in for Android to read SMS inbox and sent messages. It uses some undocumented features of Android 4.2.
https://github.com/DavidWalley/CordovaPlugin_AndroidSmsRead
Hope you can use it.

Categories

Resources