Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add apn template types #947

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/'
}
ferhatelmas marked this conversation as resolved.
Show resolved Hide resolved
*/
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