d83cd58879
TestFlight builds use the production APNs endpoint, direct Xcode builds use sandbox. Store is_sandbox on Device so each token hits the right host.
15 lines
428 B
Python
15 lines
428 B
Python
from django.db import models
|
|
|
|
|
|
class Device(models.Model):
|
|
feed = models.URLField(max_length=500)
|
|
device_token = models.CharField(max_length=200, unique=True)
|
|
is_sandbox = models.BooleanField(default=False)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
class Meta:
|
|
indexes = [models.Index(fields=["feed"])]
|
|
|
|
def __str__(self):
|
|
return f"{self.feed} -> {self.device_token[:10]}..."
|