In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about the implementation of .NET docking Aurora message push, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something from this article.
What is APP message push?
Many mobile APP will push messages to users from time to time, for example, some news APP will push news that users may be interested in, or APP will push users to choose whether to update, and so on. This is the so-called "message push".
More introduction to APP message push can be found in this article: ten minutes to learn about APP message push (Push).
Here are some examples of APP message push that are common in our daily life:
Strong marketing category:
Directly show the marketing strength and marketing mode in a call-and-sell way, in order to arouse users' desire for petty bargains and curiosity through concessions and timeliness, as follows:
Strong relevance:
In the era of information explosion, the brain will automatically screen information that is valuable to itself and information that is not valuable to themselves. if there are @ you, words like you in a message, the brain will automatically recognize it. the technique of using direct relevance lies in the skillful use of words related to "you".
Strong hot spots: the degree of attraction of hot spots to the eyeball is self-evident, but chasing hot things, news and information has a natural advantage in hot topics because of its own attributes, while other types of APP interpret and track hot spots more or less satisfactorily, especially in the area of copywriting, without Durex's ability, don't force users, on the contrary, it appears to be not up to standard.
Strong topic:
There is a saying in the marketing circle that communication cannot be created without a sense of disobedience, and topics cannot be created without being out of place. such a strong topic copy with its own communication attribute will generally hit a certain feeling in the hearts of users, such as the cynicism of society, the rebellious psychology of high housing prices, the literary and artistic heart of tourism, and so on.
Introduction to auroral push
JPush is a tried and tested large-scale App push platform, pushing tens of billions of messages every day. After integrating SDK, developers can push messages by calling API. At the same time, JPush provides a visual console on web to send notifications and analyze the push effect statistically. JPush fully supports Android, iOS and Winphone mobile phone platforms.
Why did you choose Aurora as the messaging platform for APP?
First of all, auroral push supports multi-platform push
Support large-scale message push aurora push
Convenient for interfacing. Different backend languages provide corresponding SDK.
Support for free accounts is also very friendly (but there is a resource bottleneck during the peak period of free accounts, so you can purchase premium fee-based services if you need to be timely)
Comparison of privileges?
Fast docking Jpush auroral push
Aurora detailed docking document?
Register a developer account on the official website of Aurora push.
Log in to the administrative console, create an application, and get Appkey (SDK and server identify each other through Appkey)
In the push settings, set the package name for Android, upload the certificate to iOS, enable WinPhone, and choose according to your needs.
.net FX 4.5 Project access
This project is based on C#/.NET (example of .NET Framework4.5.1) auroral push docking example, which is mainly based on the SKD provided by our .Neter. Here, I mainly encapsulate single device registration ID push, device registration ID batch push and broadcast push. For other push methods, please refer to the documentation for encapsulation.
JPuhs-Sample???? (encapsulates the sample source code)
1. Introduce the Jiguang.JPush nuget package into the project
2. Aurora push call
Namespace Jpush.Controllers {/ aurora push management / public class JPushManageController: Controller {private readonly JPushClientUtil _ jPushClientUtil; public JPushManageController (JPushClientUtil jPushClientUtil) {this._jPushClientUtil=jPushClientUtil } / single device registers ID push / public ActionResult SendPushByRegistrationId () {var isOk = _ jPushClientUtil.SendPushByRegistrationId ("Welcome to time seekers!" , "Happy New year 2022", "1507bfd3f715abecfa4", new Dictionary (), true); return Json (new {result = isOk}) } / device registration ID batch push (up to 1000 at a time) / public ActionResult SendPushByRegistrationIdList () {var registrationIds = new List () {"1507bfd3f715abecfa455", "1507bfd3f715abecfa433", "1507bfd3f715abecfa422"}; var isOk = _ jPushClientUtil.SendPushByRegistrationIdList ("Welcome to time Chaser!" , "Happy New year 2022", registrationIds, new Dictionary (), true); return Json (new {result = isOk}); / broadcast push / public ActionResult BroadcastPush () {var isOk = _ jPushClientUtil.BroadcastPush ("Welcome to the Chase!" , "Happy New year 2022", new Dictionary (), true); return Json (new {result = isOk});}
3. Auroral push tools (JPushClientUtil)
Namespace Jpush.Common {/ auroral push tool class / public class JPushClientUtil {private const string appKey = "youAppKey"; private const string masterSecret = "youMasterSecret"; private static JPushClient client = new JPushClient (appKey, masterSecret) / single device Registration ID push / push header (Android exists only) / / Notification content / device Registration ID (registration_id) / / extended parameters (pass in some parameter identifiers received by App) / / Note: whether iOS pushes the production environment (true is False whether to push the development environment) / / public bool SendPushByRegistrationId (string title, string noticeContent, string registrationid, Dictionary extrasParam = null, bool isApnsProduction = true) {/ / device identification parameter splicing var pushRegistrationId = new RegistrationIdList () PushRegistrationId.registration_id.Add (registrationid); return JPushBaseSendMessage (title, noticeContent, isApnsProduction, pushRegistrationId, extrasParam) } / device registration ID batch push (up to 1000 at a time) / push title (Android exists only) / / Notification content / Register ID (registration_id) list A maximum of 1000 parameters are pushed at a time (some parameter identifiers received by App are passed) / / Note: whether iOS pushes the production environment (true is False whether to push the development environment) / / public bool SendPushByRegistrationIdList (string title, string noticeContent, List registrationIds, Dictionary extrasParam = null, bool isApnsProduction = true) {/ / device identification parameter splicing var pushRegistrationId = new RegistrationIdList () PushRegistrationId.registration_id.AddRange (registrationIds); return JPushBaseSendMessage (title, noticeContent, isApnsProduction, pushRegistrationId, extrasParam) } / broadcast push / push header (only Android exists) / / Notification content / extension parameters (pass in some parameter identifiers received by App) / Note: whether iOS pushes the production environment (true is False / / public bool BroadcastPush (string title, string noticeContent, Dictionary extrasParam = null, bool isApnsProduction = true) {return JPushBaseSendMessage (title, noticeContent, isApnsProduction, null, extrasParam, true) } / Aurora message push public method / push title (only Android exists) / / Notification content / device registration ID (registration_id) / whether iOS pushes the production environment (true is False whether to push the development environment) / / expand the parameters / / whether to broadcast / private bool JPushBaseSendMessage (string title, string noticeContent, bool isApnsProduction, RegistrationIdList pushRegistrationId, Dictionary extrasParam, bool isRadioBroadcast = false) {try {object audience = pushRegistrationId If (isRadioBroadcast) {audience = "all" } var pushPayload = new PushPayload () {Platform = new List {"android", "ios"}, / / push platform setting Audience = audience,// push target / / notifacation: notify the container. Is the content that is pushed to the client. Together with message, there must be one or the other, and both can coexist. Notification = new Notification {Alert = noticeContent,// Notification content Android = new Android {Alert = noticeContent,// Notification content Title = title / / Notification title URIActivity = "com.king.sysclearning.platform.app.JPushOpenClickActivity", / / this field is used to specify the activity that the developer wants to open The value is the "android:name" attribute value of the activity node Adapts to Huawei, Xiaomi and vivo vendor channel jump URIAction = "com.king.sysclearning.platform.app.JPushOpenClickActivity". / / this field is used to specify the activity that the developer wants to open. The value is "activity"-"intent-filter"-"action" node's "android:name" attribute value. Adapt to oppo, fcm jump Extras = extrasParam / / here customize the Key/Value information in JSON format for business use. }, IOS = new IOS {Alert = noticeContent, Badge = "+ 1", / / this item specifies that the badge for this push automatically adds 1 Extras = extrasParam / / the Key/Value information in the custom JSON format for business use. }}, Options = new Options// optional parameters {/ / iOS environment inconsistent problem: when API pushes messages to iOS, you need to set the environment specified by apns_production, false for development and true for production. IsApnsProduction = isApnsProduction// sets up the iOS push production environment. Do not set the default development environment. Var response = client.SendPush (pushPayload); / / 200 must be correct. All exceptions do not use the 200R code if (response.StatusCode = = HttpStatusCode.OK) {return true;} else {return false }} catch (Exception ex) {return false;} public class RegistrationIdList {/ device registration ID / public List registration_id {get; set;} = new List () }} after reading the above, do you have any further understanding of the implementation of .NET docking Aurora message push? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.