We are trying to integrate the Baidu SDK and use it together with Azure Notification Hub in the back-end.
In Android we are using the SDK: lib-techain-release-3.5.7.4
To get the PushId of the device we use:
public class BaiduReceiver extends BroadcastReceiver {
private static final int TYPE_REGISTRATION = 1;
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (!PUSH_ACTION.equals(action)) {
return;
}
Bundle bundle = intent.getExtras();
int type = bundle.getInt("event_type", -1);
switch (type) {
case TYPE_REGISTRATION:
String uid = bundle.getString("push_uid");
break;
default:
break;
}
}
}
Which works. This ID can be used to send push notifications from the Baidu console. However, when integrating with Azure Notification Hub, it also requires a "Channel ID" (see https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.notificationhubs.baiduregistrationdescription?view=azure-dotnet)
How do we obtain this channel Id in Android?