0

click_action are not working.

What should be specified for intent-filter for click_action? action? or category? or data(url)?

granoeste
  • 1,531
  • 3
  • 12
  • 15
  • ***not** the downvoter* -- Hi. Have you gone through the answers [here](http://stackoverflow.com/q/37407366/4625829)? – AL. Mar 01 '17 at 06:28

2 Answers2

0
    <activity
        android:name="com.your_activity_name"
        android:configChanges="orientation|screenLayout|screenSize"
        android:label="@string/app_name">

        <intent-filter>
            <action android:name="com.your activity page"></action>
            <category android:name="android.intent.category.DEFAULT"/>                
        </intent-filter>
    </activity>

and use click action in your payload in a server like this.

$notification = array
    (
    'icon' => 'ic',
    'title' => 'title',
    'body' => ' msg',
    'click_action' => 'your activity  name of action'
); 
Andyson
  • 55
  • 1
  • 7
android_jain
  • 788
  • 8
  • 19
  • 1
    Although I tried specifying a character string of , The designation of was missing. I see. "In order to receive implicit intents, you must include the CATEGORY_DEFAULT category in the intent filter." – granoeste Mar 01 '17 at 07:21
  • its my code you can use exect or you can remove some attribute depend on your requerement – android_jain Mar 01 '17 at 07:45
0
Notification sample
"notification" : {
    "click_action" : "android.intent.action.MAIN", 
    "body" : "abc", 
    "title" : "abc", 
    "deeplink": "https://westyle.vn/account?cate=orders&orderid=11948294",
    "icon" : "ic_..."
}
Manifest file
<activity android:name=".LaunchAppActivity"
          android:exported="true"
          android:windowSoftInputMode="adjustPan"
          android:screenOrientation="portrait">
    <intent-filter>
        <!--must be the same in click_action-->
        <action android:name="android.intent.action.MAIN" />    

The important part is the full string of action name tag in manifest should be exactly the same in click_action

Jan Schultke
  • 17,446
  • 6
  • 47
  • 96