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

Add reply actions #61

Open
m1ga opened this issue Mar 7, 2019 · 4 comments
Open

Add reply actions #61

m1ga opened this issue Mar 7, 2019 · 4 comments

Comments

@m1ga
Copy link
Collaborator

m1ga commented Mar 7, 2019

For Android: https://segunfamisa.com/posts/notifications-direct-reply-android-nougat

@hansemannn
Copy link
Owner

iOS manages this via the Ti.App.iOS.USER_NOTIFICATION_BEHAVIOR_TEXTINPUT flag so an adjustment is not required. But pretty cool to have it on both platforms!

@SilvioLuis
Copy link

SilvioLuis commented Mar 7, 2019

@hansemannn would be great! I need this functionality for an app.

@hansemannn
Copy link
Owner

@SilvioLuis Then you should hire @m1ga to implement this for you. Otherwise this will take at least a few more weeks, since no one else needs this right now.

@m1ga
Copy link
Collaborator Author

m1ga commented Mar 9, 2019

can't catch the text yet but adding this will already show a reply box:

// reply function
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && params.get("reply") != null
    && TiConvert.toBoolean(params.get("reply"), false) == true) {
    RemoteInput remoteInput = new RemoteInput.Builder(context.getPackageName()).setLabel("Reply").build();
    NotificationCompat.Action replyAction =
        new NotificationCompat.Action
            .Builder(android.R.drawable.stat_sys_warning, "Reply", contentIntent)
            .addRemoteInput(remoteInput)
            .setAllowGeneratedReplies(true)
            .build();
    builder.addAction(replyAction);
}

Screenshot_20190309-213954

but #57 and updating the libraries is a priority at the moment. Just some code for later or someone else ;-)

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

No branches or pull requests

3 participants