open-im-server icon indicating copy to clipboard operation
open-im-server copied to clipboard

[FEATURE REQUEST] Offline push How to customized configuration information for different channels

Open phpmaple opened this issue 1 year ago • 6 comments
trafficstars

Why this feature?

I cannot customize the diverse configuration of offline push channels.

Suggested Solution

Support customized configurations for different channels in a certain way, such as Huawei and Xiaomi.

Additional Information

No response

phpmaple avatar Jul 26 '24 10:07 phpmaple

It is clear that OpenIM only supports unified push services, such as jpush and getui, which are push integration platforms. We suggest that you integrate the vendor-specific push services(huawei,xiaomi) yourself and then provide a unified interface for OpenIM to call. This is how we handle it in our business operations.

printlin avatar Jul 30 '24 02:07 printlin

How can I provide my custom interface for OpenIM to call, using webhook? Is there related documentation?

phpmaple avatar Jul 30 '24 02:07 phpmaple

This is a custom feature that involves modifying the source code, and there is no official documentation available. You will need to read the source code yourself, understand the push business logic, and modify the code. You can refer to the code in internal/push/offlinepush as a guide.

printlin avatar Jul 30 '24 02:07 printlin

I have already implemented this in our business and successfully deployed it. Feel free to reach out with any questions.

printlin avatar Jul 30 '24 02:07 printlin

How can I provide my custom interface for OpenIM to call, using webhook? Is there related documentation?

I found a beforeOfflinePush webhook, which might allow you to meet your requirements without modifying the source code.

printlin avatar Jul 30 '24 07:07 printlin

I have already implemented this in our business and successfully deployed it. Feel free to reach out with any questions.

How to configure push notifications for different Android platforms


OfflinePushInfo title | string desc | string iOSPushSound | string | ios iOSBadgeCount | boolean | ios operatorUserID | string |   ex | string |

No android platform configuration, how in internal/push/offlinepush configuration set different platforms


platformID iOS 1, Android 2, Windows 3, OSX 4, WEB 5, Mini Program 6,linux 7

Sure, beforeOfflinePush has get platform from platformID, But it is not a configuration for the Android platform

shang513121645 avatar May 19 '25 04:05 shang513121645

How can I provide my custom interface for OpenIM to call, using webhook? Is there related documentation?

I found a beforeOfflinePush webhook, which might allow you to meet your requirements without modifying the source code.

func (pushReq *PushReq) setPushChannel(title string, body string) {
	pushReq.PushChannel = &PushChannel{}
	// autoBadge := "+1"
	pushReq.PushChannel.Ios = &Ios{}
	notify := "notify"
	pushReq.PushChannel.Ios.NotificationType = &notify
	pushReq.PushChannel.Ios.Aps.Sound = "default"
	pushReq.PushChannel.Ios.Aps.Alert = Alert{
		Title: title,
		Body:  body,
	}
	pushReq.PushChannel.Android = &Android{}
	pushReq.PushChannel.Android.Ups.Notification = Notification{
		Title:     title,
		Body:      body,
		ClickType: "startapp",
	}
	pushReq.PushChannel.Android.Ups.Options = Options{
		HW: struct {
			DefaultSound bool   `json:"/message/android/notification/default_sound"`
			ChannelID    string `json:"/message/android/notification/channel_id"`
			Sound        string `json:"/message/android/notification/sound"`
			Importance   string `json:"/message/android/notification/importance"`
		}{ChannelID: "RingRing4", Sound: "/raw/ring001", Importance: "NORMAL"},
		XM: struct {
			ChannelID string `json:"/extra.channel_id"`
		}{ChannelID: "high_system"},
		VV: struct {
			Classification int "json:\"/classification\""
		}{
			Classification: 1,
		},
	}
}

【channel_id 】It can only be adapted to one Android platform

shang513121645 avatar May 19 '25 04:05 shang513121645