Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Could accept an Parcelable on sendNewMessage() #126

Closed
amadeu01 opened this issue Apr 18, 2018 · 4 comments · Fixed by #139
Closed

Feature: Could accept an Parcelable on sendNewMessage() #126

amadeu01 opened this issue Apr 18, 2018 · 4 comments · Fixed by #139

Comments

@amadeu01
Copy link
Contributor

It would be great to be possible to add extras to the sentMessageIntent and deliveryIntents

So, one manner of doing that is by passing a Parcelable throughout the functions calls, and then the library could add them to their intents.

Then I could be even easier to find out which SMS was sent we the Receiver is called. Once the Parcelable will come with the intent passed to the Receivers

            Intent sentMessageIntent = new Intent(SENT);
            sentMessageIntent.putExtra(SENT_SMS_BUNDLE, message);

            PendingIntent sentIntent = PendingIntent
                    .getBroadcast(mContext, (int) System.currentTimeMillis(), sentMessageIntent,
                            PendingIntent.FLAG_UPDATE_CURRENT);

            Intent delivered = new Intent(DELIVERED);
            delivered.putExtra(DELIVERED_SMS_BUNDLE, message);

            PendingIntent deliveryIntent = PendingIntent
                    .getBroadcast(mContext, (int) System.currentTimeMillis(), delivered,
                            PendingIntent.FLAG_UPDATE_CURRENT);

            sentIntents.add(sentIntent);

            deliveryIntents.add(deliveryIntent);

private void sendSmsMessage(String text, String[] addresses, long threadId, int delay) {

public void sendNewMessage(Message message, long threadId) {

@NickM-27
Copy link

NickM-27 commented May 5, 2018

This would be a great idea, definitely would help me a lot in making things easier, I might look into making a pull request for this

amadeu01 added a commit to amadeu01/android-smsmms that referenced this issue Sep 5, 2018
@amadeu01
Copy link
Contributor Author

@NickM-27 I did a PR for this, if you have the time, I would appreciate you having a look at it.

@NickM-27
Copy link

@amadeu01 Looks good to me

@amadeu01
Copy link
Contributor Author

@klinker24 could you have a look at the PR? really thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants