I am trying to send user data using the push search notification service, but when fetching from the Bundle, null values ββare always returned.
User Broadcast Receiver:
@Override public void onReceive(Context context, Intent intent) { Log.e("Receiver","Invoked"); Bundle bundle = intent.getExtras(); Intent contentIntent = new Intent(context, MainPage.class); String alertMsg = bundle.getString("heading");
Manifest declaration:
<receiver android:name=".receiver.NotificationReceiver" android:exported="false"> <intent-filter> <action android:name="link_notification"/> </intent-filter> </receiver>
And I send the following JSON from the syntax analysis panel:
{ "dataString": "objectId", "heading": "type", "action": "link_notification" }
When I log Bundle data, I can see the header and dataString , but can't access it. A package always returns null.
Please, help! Thanks.
source share