java - How to subscribe multiple device token at one time in AWS SNS -
i using aws sns sending push notification in android , ios devices. can tell me how subscribe multiple device tokens @ same time (not 1 one).
i have code 1 one subscription of device token.
createtopicrequest createtopicrequest = new createtopicrequest("mynewtopic"); createtopicresult createtopicresult = snsclient.createtopic(createtopicrequest); //print topicarn system.out.println(createtopicresult); //get request id createtopicrequest sns metadata system.out.println("createtopicrequest - " + snsclient.getcachedresponsemetadata(createtopicrequest)); string topicarn = createtopicresult.gettopicarn() createplatformapplicationresult platformapplicationresult string platformapplicationarn = '' long = system.currenttimemillis() println("----before-subscription-------" + now) platformtokens.each { string platformtoken -> try { platformapplicationresult = createplatformapplication(applicationname, platform, principal, credential); } catch (exception e) { system.out.println("----------------" + e) } platformapplicationarn = platformapplicationresult.getplatformapplicationarn(); createplatformendpointresult platformendpointresult = createplatformendpoint(platform, "customdata - useful store endpoint specific data", platformtoken, platformapplicationarn); string endpointarn = platformendpointresult.getendpointarn() // system.out.println("------------endpointarn--------------" + endpointarn); //subscribe sns topic subscriberequest subrequest = new subscriberequest(topicarn, "application", endpointarn); snsclient.subscribe(subrequest);
with 1 one subscription taking lot of time more 100 device tokens. please me solve problem.
thanks
Comments
Post a Comment