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

Android actions #833

Merged
merged 4 commits into from
Mar 5, 2018
Merged

Android actions #833

merged 4 commits into from
Mar 5, 2018

Conversation

SergChr
Copy link
Contributor

@SergChr SergChr commented Mar 5, 2018

Description

Added action buttons generating on Android (iOS-way was described in the issue).

How it works

Read the actions field in the custom_notification object in a remote notification:

{
 "to" : "some_token",
 "data" : {
     "custom_notification": {
     	      "actions": "Call, Reject",
	      "color":"#00ACD4",
	      "priority":"max"
    }
 }
}

So the result should be a notification with two buttons named Call, Reject.
When we press the button the notification body will contain the _actionIdentifier with pointed button name, so we can identify what button was pressed. For example, if we press Call, the _actionIdentifier also will be Call.

@evollu
Copy link
Owner

evollu commented Mar 5, 2018

can you name it "android_actions"?

@SergChr
Copy link
Contributor Author

SergChr commented Mar 5, 2018

@evollu Of course! A field is changed.

@evollu evollu merged commit 739816e into evollu:master Mar 5, 2018
@evollu
Copy link
Owner

evollu commented Mar 5, 2018

thanks. I will try adding an example

@evollu
Copy link
Owner

evollu commented Mar 5, 2018

is it possible for android_actions to be an array of string?
in some rare cases the button itself might contain ,?

@SergChr
Copy link
Contributor Author

SergChr commented Mar 5, 2018

@evollu Yes, it's possible. It would be better. I'll modify it tomorrow.

@evollu
Copy link
Owner

evollu commented Mar 5, 2018

git error on Intent actionIntent = new Intent(mContext, intentClass);
looks like you forgot to include change for intentClass

@SergChr
Copy link
Contributor Author

SergChr commented Mar 5, 2018

@evollu You're right. Will be fixed

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 this pull request may close these issues.

None yet

2 participants