বিষয়বস্তুতে যান

Xamarin iOS SDK

মডিউল সোর্স
নমুনা ডাউনলোড করুন

আপনার Xamarin iOS অ্যাপ্লিকেশনের সাথে Pushwoosh ইন্টিগ্রেট করতে:

১. আপনার সলিউশনে Pushwoosh.Xamarin.iOS nuget প্যাকেজ যোগ করুন।

২. আপনার প্রজেক্টে, AppDelegate.cs খুলুন এবং using Pushwoosh লাইন যোগ করে Pushwoosh কানেক্ট করুন।

৩. আপনার Info.plist-এ আপনার Pushwoosh অ্যাপ্লিকেশন আইডির স্ট্রিং ভ্যালু সহ Pushwoosh_APPID কী যোগ করুন।

৪. নিম্নলিখিত ইম্পোর্টগুলি সাজান:

  • using Pushwoosh;
  • using UserNotifications;

৫. নিচের মেথডগুলো AppDelegate ক্লাসে যোগ করুন:

public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
PushNotificationManager.PushManager.HandlePushRegistration (deviceToken);
}
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
{
PushNotificationManager.PushManager.HandlePushRegistrationFailure (error);
}
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
{
PushNotificationManager.PushManager.HandlePushReceived (userInfo);
}

৬. নিচের কোডটি public override bool FinishedLaunching(UIApplication app, NSDictionary launchOptions) মেথডে যোগ করুন:

PushNotificationManager pushmanager = PushNotificationManager.PushManager;
pushmanager.Delegate = new PushDelegate();
UNUserNotificationCenter.Current.Delegate = pushmanager.notificationCenterDelegate;
if (options != null) {
if (options.ContainsKey (UIApplication.LaunchOptionsRemoteNotificationKey)) {
pushmanager.HandlePushReceived(options);
}
}
pushmanager.RegisterForPushNotifications();

. AppDelegate-এ নিম্নলিখিত ক্লাসটি যোগ করুন:

public class PushDelegate : PushNotificationDelegate
{
public override void OnPushAccepted(PushNotificationManager pushManager, NSDictionary pushNotification)
{
Console.WriteLine(“Push accepted: ” + pushNotification);
}
public override void OnPushReceived(PushNotificationManager pushManager, NSDictionary pushNotification, bool onStart)
{
Console.WriteLine(“Push received: ” + pushNotification);
}
public override void OnDidRegisterForRemoteNotificationsWithDeviceToken(NSString token)
{
Console.WriteLine(“Registered for push notifications: ” + token);
}
public override void OnDidFailToRegisterForRemoteNotificationsWithError(NSError error)
{
Console.WriteLine(“Error: ” + error);
}
}

আমাদের সাথে আপনার মতামত শেয়ার করুন

Anchor link to

আপনার মতামত আমাদের একটি উন্নত অভিজ্ঞতা তৈরি করতে সাহায্য করে, তাই SDK ইন্টিগ্রেশন প্রক্রিয়ার সময় আপনার কোনো সমস্যা হলে আমরা আপনার কাছ থেকে শুনতে চাই। আপনি যদি কোনো অসুবিধার সম্মুখীন হন, তাহলে অনুগ্রহ করে আমাদের সাথে আপনার মতামত শেয়ার করতে দ্বিধা করবেন না এই ফর্মের মাধ্যমে

Was this page useful?