Exemple #1
0
	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()
Exemple #2
0
    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()
Exemple #3
0
def registertoken(request):
	token = request.POST['token']
	apnstoken = APNSToken(token=token)
	apnstoken.save()
	return HttpResponse(json.dumps({"status":"success"}))
Exemple #4
0
def registertoken(request):
    token = request.POST['token']
    apnstoken = APNSToken(token=token)
    apnstoken.save()
    return HttpResponse(json.dumps({"status": "success"}))