2

react-native expo for application(android) and python[django] for backend , i have created an app and successfully sent notification from python to my app [i am using expo notifications for sending notifications] but i want to schedule them , its possible in react native directly but i want to do it from python for some other purpose. can someone help me with this

this is my code for generating notification

@api_view(['GET'])
def sendNotification(request):
  token = StoreToken.objects.all().last()
  print(token)
  if token == None:
      return Response({'detail':'something went wrong'}, status=status.HTTP_400_BAD_REQUEST) 
  
  message = {
    'to' :  token.token,
    'title' : 'hello',
    'body' : 'this is body'
  }
  return r.post('https://exp.host/--/api/v2/push/send', json = message)
faijan memon
  • 183
  • 1
  • 9

1 Answers1

2

i know this is not prefect way but this helped me and worked for me really well, may this work for you as well

https://somehowitworked.dev/push-notifications-react-native-expo-django/

this above written blog will help you to set up your code in expo and python and also will guide you through integration

Live Coder
  • 108
  • 6
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 09 '22 at 09:44