Skip to content

Commit

Permalink
feat: add apn template types (#947)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas committed Apr 7, 2022
1 parent 5eced26 commit f8b1faa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,26 +542,27 @@ export class StreamChat<StreamChatGenerics extends ExtendableGenerics = DefaultG
* updateAppSettings - updates application settings
*
* @param {AppSettings} options App settings.
* IE: {
"apn_config": {
"auth_type": "token",
"auth_key": fs.readFileSync(
'./apn-push-auth-key.p8',
'utf-8',
),
"key_id": "keyid",
"team_id": "teamid", //either ALL these 3
"notification_template": "notification handlebars template",
"bundle_id": "com.apple.your.app",
"development": true
},
"firebase_config": {
"server_key": "server key from fcm",
"notification_template": "notification handlebars template"
"data_template": "data handlebars template"
},
"webhook_url": "https://acme.com/my/awesome/webhook/"
}
* IE: {
'apn_config': {
'auth_type': 'token',
'auth_key": fs.readFileSync(
'./apn-push-auth-key.p8',
'utf-8',
),
'key_id': 'keyid',
'team_id': 'teamid',
'notification_template": 'notification handlebars template',
'bundle_id': 'com.apple.your.app',
'development': true
},
'firebase_config': {
'server_key': 'server key from fcm',
'notification_template': 'notification handlebars template',
'data_template': 'data handlebars template',
'apn_template': 'apn notification handlebars template under v2'
},
'webhook_url': 'https://acme.com/my/awesome/webhook/'
}
*/
async updateAppSettings(options: AppSettings) {
if (options.apn_config?.p12_cert) {
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ export type AppSettings = {
// all possible file mime types are https://www.iana.org/assignments/media-types/media-types.xhtml
file_upload_config?: FileUploadConfig;
firebase_config?: {
apn_template?: string;
credentials_json?: string;
data_template?: string;
notification_template?: string;
Expand Down Expand Up @@ -1656,6 +1657,7 @@ export type PushProviderAPN = {
};

export type PushProviderFirebase = {
firebase_apn_template?: string;
firebase_credentials?: string;
firebase_data_template?: string;
firebase_notification_template?: string;
Expand Down Expand Up @@ -1837,6 +1839,7 @@ export type FileUploadConfig = {
};

export type FirebaseConfig = {
apn_template?: string;
credentials_json?: string;
data_template?: string;
enabled?: boolean;
Expand Down

0 comments on commit f8b1faa

Please sign in to comment.