diff --git a/plexpy/mobile_app.py b/plexpy/mobile_app.py index 4d1267a1..f3c835c3 100644 --- a/plexpy/mobile_app.py +++ b/plexpy/mobile_app.py @@ -198,11 +198,10 @@ def validate_onesignal_id(onesignal_id): return 2 headers = {'Content-Type': 'application/json'} - params = {'app_id': _ONESIGNAL_APP_ID} logger.info("Tautulli MobileApp :: Validating OneSignal ID") try: - r = requests.get('https://onesignal.com/api/v1/players/{}'.format(onesignal_id), headers=headers, params=params) + r = requests.get(f'https://api.onesignal.com/apps/{_ONESIGNAL_APP_ID}/subscriptions/{onesignal_id}/user/identity', headers=headers) status_code = r.status_code logger.info("Tautulli MobileApp :: OneSignal ID validation returned status code %s", status_code) return int(status_code == 200) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index eb63df33..2029aa01 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -4044,7 +4044,7 @@ class TAUTULLIREMOTEAPP(Notifier): #logger.debug("Salt (base64): {}".format(base64.b64encode(salt))) payload = {'app_id': mobile_app._ONESIGNAL_APP_ID, - 'include_player_ids': [device['onesignal_id']], + 'include_subscription_ids': [device['onesignal_id']], 'contents': {'en': 'Tautulli Notification'}, 'data': {'encrypted': True, 'version': 2, @@ -4059,7 +4059,7 @@ class TAUTULLIREMOTEAPP(Notifier): "Install the library to encrypt the notifications.") payload = {'app_id': mobile_app._ONESIGNAL_APP_ID, - 'include_player_ids': [device['onesignal_id']], + 'include_subscription_ids': [device['onesignal_id']], 'contents': {'en': 'Tautulli Notification'}, 'data': {'encrypted': False, 'plain_text': plaintext_data, @@ -4070,7 +4070,7 @@ class TAUTULLIREMOTEAPP(Notifier): headers = {'Content-Type': 'application/json'} - return self.make_request('https://onesignal.com/api/v1/notifications', headers=headers, json=payload) + return self.make_request('https://api.onesignal.com/notifications', headers=headers, json=payload) def get_devices(self): db = database.MonitorDatabase()