खोज…


टिप्पणियों

AWS सरल अधिसूचना सेवा लिंगो:

समापन बिंदु - समापन बिंदु एक फोन, ईमेल पता या जो कुछ भी हो सकता है, यह वही है जो AWS SNS एक अधिसूचना के साथ वापस मार सकता है

विषय - अनिवार्य रूप से एक समूह जिसमें आपके सभी समापन बिंदु होते हैं

सदस्यता लें - आप नोटिफिकेशन प्राप्त करने के लिए अपने फोन / क्लाइंट को साइन अप करते हैं

सामान्य पुश अधिसूचना लिंगो:

APNS - Apple पुश अधिसूचना सेवा। Apple एकमात्र ऐसा व्यक्ति है जो पुश नोटिफिकेशन भेज सकता है। यही कारण है कि हम अपने ऐप को उचित प्रमाण पत्र के साथ प्रावधान करते हैं। हम एडब्ल्यूएस एसएनएस को यह प्रमाणपत्र प्रदान करते हैं कि ऐप्पल हमें एसएनएस को अपनी ओर से एपीएनएस को एक अधिसूचना भेजने के लिए अधिकृत करता है।

GCM - Google क्लाउड मैसेजिंग APNS के समान है। Google एकमात्र ऐसा है जो सीधे पुश सूचनाएं भेज सकता है। इसलिए हम सबसे पहले अपना ऐप GCM में रजिस्टर करते हैं और अपने टोकन को AWS SNS को सौंपते हैं। SNS GCM से निपटने और डेटा पर भेजने के सभी जटिल सामान को संभालता है।

iOS उदाहरण

  1. आपको एक विकास उपकरण की आवश्यकता होगी
  2. अपने Apple डेवलपर खाते में जाएं और पुश नोटिफिकेशन सक्षम करने के साथ एक प्रोविज़निंग प्रोफाइल बनाएं
  3. आपको अपने फ़ोन (AWS, Azure..etc) को सूचित करने के लिए किसी प्रकार की आवश्यकता होगी। हम यहाँ AWS का उपयोग करेंगे
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    global::Xamarin.Forms.Forms.Init();

   //after typical Xamarin.Forms Init Stuff

   //variable to set-up the style of notifications you want, iOS supports 3 types

   var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
              UIUserNotificationType.Alert |
              UIUserNotificationType.Badge |
              UIUserNotificationType.Sound,
              null );  

       
        //both of these methods are in iOS, we have to override them and set them up
        //to allow push notifications

        app.RegisterUserNotificationSettings(pushSettings);  //pass the supported push notifications settings to register app in settings page

     
}

public override async void RegisteredForRemoteNotifications(UIApplication application, NSData token)
    {
        AmazonSimpleNotificationServiceClient snsClient = new AmazonSimpleNotificationServiceClient("your AWS credentials here");

        // This contains the registered push notification token stored on the phone. 
        var deviceToken = token.Description.Replace("<", "").Replace(">", "").Replace(" ", ""); 

        if (!string.IsNullOrEmpty(deviceToken))
        {
            //register with SNS to create an endpoint ARN, this means AWS can message your phone
            var response = await snsClient.CreatePlatformEndpointAsync(
            new CreatePlatformEndpointRequest
            {
                Token = deviceToken,
                PlatformApplicationArn = "yourARNwouldgohere" /* insert your platform application ARN here */
            });

            var endpoint = response.EndpointArn;

            //AWS lets you create topics, so use subscribe your app to a topic, so you can easily send out one push notification to all of your users
            var subscribeResponse = await snsClient.SubscribeAsync(new SubscribeRequest
            {
                TopicArn = "YourTopicARN here",
                Endpoint = endpoint,
                Protocol = "application"

            });

        }

    }


Modified text is an extract of the original Stack Overflow Documentation
के तहत लाइसेंस प्राप्त है CC BY-SA 3.0
से संबद्ध नहीं है Stack Overflow