Closed akvashi closed 6 years ago
On a Pixel 2 with Android 8.0
When trying to use a custom PushAnalyticsReceiver, the Receiver is declared in the Manifest according to the documentation.
This code is called
List<ResolveInfo> result = mContext.getPackageManager().queryBroadcastReceivers(intent, 0); if (result != null && result.size() > 0) { LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); }
results will have a size > 0 because the BroadcastReceiver is declared.
But sendBroadcast(intent) will not work because within that method
ArrayList<LocalBroadcastManager.ReceiverRecord> entries = (ArrayList)this.mActions.get(intent.getAction()); if(entries != null) {...}
is called but the entries are null because
LocalBroadcastManager.getInstance(mContext).registerReceiver is not called.
LocalBroadcastManager.getInstance(mContext).registerReceiver
So LocalBroadcastManager has no knowledge of the larger BroadcastReceiver query.
Also tested on an emulator at API 19. Same results.
custom PushAnalyticsReceiver does not work.
https://stackoverflow.com/questions/23364668/register-a-local-broadcastreceiver-in-androidmanifest-xml
Hey @akvashi thanks for the report - we're looking into a solution here and will likely release an SDK update to address.
Closing this, the issue was fixed in version 5.1.2
On a Pixel 2 with Android 8.0
When trying to use a custom PushAnalyticsReceiver, the Receiver is declared in the Manifest according to the documentation.
This code is called
results will have a size > 0 because the BroadcastReceiver is declared.
But sendBroadcast(intent) will not work because within that method
is called but the entries are null because
LocalBroadcastManager.getInstance(mContext).registerReceiver
is not called.So LocalBroadcastManager has no knowledge of the larger BroadcastReceiver query.
Also tested on an emulator at API 19. Same results.
custom PushAnalyticsReceiver does not work.