Skip to content

Commit

Permalink
Remove sendNotification from OneSignalAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezp committed Jul 15, 2024
1 parent 1829c77 commit 359c788
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
4 changes: 0 additions & 4 deletions src/OneSignalApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export default class OneSignalApi {
return OneSignalApiShared.updatePlayer(appId, playerId, options);
}

static sendNotification(appId: string, playerIds: Array<string>, titles, contents, url, icon, data, buttons) {
return OneSignalApiShared.sendNotification(appId, playerIds, titles, contents, url, icon, data, buttons);
}

static jsonpLib(url: string, fn: Function) {
JSONP(url, null, fn);
}
Expand Down
23 changes: 0 additions & 23 deletions src/OneSignalApiShared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,6 @@ export default class OneSignalApiShared {
return OneSignalApiBase.put(`players/${playerId}`, { app_id: appId, ...options });
}

static sendNotification(appId: string, playerIds: Array<string>, titles, contents, url, icon, data, buttons) {
var params = {
app_id: appId,
contents: contents,
include_player_ids: playerIds,
isAnyWeb: true,
data: data,
web_buttons: buttons
};
if (titles) {
(params as any).headings = titles;
}
if (url) {
(params as any).url = url;
}
if (icon) {
(params as any).chrome_web_icon = icon;
(params as any).firefox_icon = icon;
}
Utils.trimUndefined(params);
return OneSignalApiBase.post('notifications', params);
}

static async createUser(deviceRecord: DeviceRecord): Promise<string | null> {
const serializedDeviceRecord = deviceRecord.serialize();
Utils.enforceAppId(serializedDeviceRecord.app_id);
Expand Down

0 comments on commit 359c788

Please sign in to comment.