c# - Update to Azure Notification hub tags fails when tags list is empty -
i've made notification hub on microsoft azure in order send notification both in android , ios. problem when phone registers in tags , removes them, still receiving notifications tags have been removed. seems when send empty (not null) list, update fails. ideas?
here on register code:
protected override void onregistered (context context, string registrationid) { log.verbose (mybroadcastreceiver.tag, "gcm registered: " + registrationid); registrationid = registrationid; hub = new notificationhub (constants.notificationhubname, constants.listenconnectionstring, context); try { hub.unregisterall (registrationid); } catch (exception ex) { log.error (mybroadcastreceiver.tag, ex.message); } saveandload_droid load = new saveandload_droid (); string output_settings = load.loadtext ("settings.txt"); string [] categories = output_settings.split ('@'); var notnullcategories = categories.where (x => x != "0").tolist(); try { var hubregistration = hub.register (registrationid, notnullcategories.toarray ()); } catch (exception ex) { log.error (mybroadcastreceiver.tag, ex.message); } }
the setting.txt file looks like: 5@12@9
Comments
Post a Comment