Reputation: 1543
I need the both tokens...I am using PushNotification Plugin...I know its return the token...but i think the documentation is very bad...I dont need to show a notification...I ONLY need the tokens...ONLY IT Can someone save me??? I really need it. Do I need some configuration in app developer? I've already got the sender id for android and I initialized the plugin in both: AppDelegate and MainActivity Help PLEEEAAAAAAASE
My class in pcl
using PushNotification.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using PushNotification.Plugin.Abstractions;
namespace neoFly_Montana
{
public class PushNot : IPushNotificationListener
{
public void OnError(string message, DeviceType deviceType)
{
throw new NotImplementedException();
}
public void OnMessage(JObject values, DeviceType deviceType)
{
throw new NotImplementedException();
}
public void OnRegistered(string token, DeviceType deviceType)
{
throw new NotImplementedException();
}
public void OnUnregistered(DeviceType deviceType)
{
throw new NotImplementedException();
}
public bool ShouldShowNotification()
{
throw new NotImplementedException();
}
}
}
Upvotes: 1
Views: 2221
Reputation: 15322
Both Google and Apple will send you the token in the OnRegistered
method once the device has been registered with APNS or GCM/FCM.
In OnRegistered
you can add logic to save the token.
public void OnRegistered(string token, DeviceType deviceType)
{
//use token here
}
Upvotes: 1