Hi I want to set expiry date for azure notification hub registration. I use the below line for notification hub registration,
NotificationHub hub = new NotificationHub(mGCMPreferences.getHubName(), mGCMPreferences.getConnectionString(), mContext);
String registerId = hub.register(token, mGCMPreferences.getTagId()).getRegistrationId();
Could you please suggest me any idea to set expiry date while registration?
According to your code, it seems that you were using Azure NotificatonHubs SDK for Android to implement your needs, so please view its javadocs at here.
According to the javadoc & source code for class
Registrationof Azure NotificationHubs SDK for Android, there is not any public method for settingExpirationTimeto update the theRegistrationobject fromNotificationHubobject. So it's not possible to set expiration data at the android end.However, you can try to use the Azure NotificationHubs SDK for Java backend to do it, please refer to the backend javadocs at here.
As reference, here is a sample code.
If you have to set the expiration data at the Android end, my suggestion is that you can try to use the Notification Hubs REST API
Create or Updatewith the propertyregistrationTtlto do it.