def send_push_course_update(course_key_string, course_subscription_id, course_display_name):
 if settings.PARSE_KEYS:
  try:
   register(settings.PARSE_KEYS['APPLICATION_ID'], settings.PARSE_KEYS['REST_API_KEY'])
   push_payload = {'action': 'course.announcement', 'notification-id': unicode(uuid4()), 'course-id': course_key_string, 'course-name': course_display_name}
   push_channels = [course_subscription_id]
   Push.alert(data=push_payload, channels={'$in': push_channels}, where={'deviceType': 'android'})
   push_payload.update({'alert': '', 'content-available': 1})
   Push.alert(data=push_payload, channels={'$in': push_channels}, where={'deviceType': 'ios'})
  except ParseError as error:
   log_exception(error.message)

def send_push_course_update ( course_key_string , course_subscription_id , course_display_name ) : if settings . PARSE_KEYS : try : register ( settings . PARSE_KEYS [ 'APPLICATION_ID' ] , settings . PARSE_KEYS [ 'REST_API_KEY' ] ) push_payload = { 'action' : 'course.announcement' , 'notification-id' : unicode ( uuid4 ( ) ) , 'course-id' : course_key_string , 'course-name' : course_display_name } push_channels = [ course_subscription_id ] Push . alert ( data = push_payload , channels = { '$in' : push_channels } , where = { 'deviceType' : 'android' } ) push_payload . update ( { 'alert' : '' , 'content-available' : 1 } ) Push . alert ( data = push_payload , channels = { '$in' : push_channels } , where = { 'deviceType' : 'ios' } ) except ParseError as error : log_exception ( error . message )
sends a push notification for a course update .