def setUp(self): alert = APNSAlert(body="alerttest1",has_data=False) alert.save() apspayload = APNSAPSPayload(payload_ref="apstest1",alert=alert) apspayload.save() msg = APNSMessage(message_ref="testmsg1",aps_payload=apspayload,has_data=False) msg.save() token = APNSToken(token="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",expired=False) token.save() msgq = MsgQueue(apnstoken=token,apnsmessage=msg,msg_sent=False) msgq.save()
def setUp(self): alert = APNSAlert(body="alerttest1", has_data=False) alert.save() apspayload = APNSAPSPayload(payload_ref="apstest1", alert=alert) apspayload.save() msg = APNSMessage(message_ref="testmsg1", aps_payload=apspayload, has_data=False) msg.save() token = APNSToken( token= "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", expired=False) token.save() msgq = MsgQueue(apnstoken=token, apnsmessage=msg, msg_sent=False) msgq.save()
def registertoken(request): token = request.POST['token'] apnstoken = APNSToken(token=token) apnstoken.save() return HttpResponse(json.dumps({"status":"success"}))
def registertoken(request): token = request.POST['token'] apnstoken = APNSToken(token=token) apnstoken.save() return HttpResponse(json.dumps({"status": "success"}))