Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. export default class App extends React.Component {
  2. async componentDidMount(){
  3. // Bunu denedim işe yaramadı: PushNotification.cancelAllLocalNotifications();
  4. PushNotification.configure({
  5. onRegister: function(token) {
  6. console.log("TOKEN:", token);
  7. },
  8.  
  9. onNotification: function(notification) {
  10. console.log("NOTIFICATION:", notification);
  11. },
  12.  
  13. senderID: "YOUR GCM (OR FCM) SENDER ID",
  14.  
  15. permissions: {
  16. alert: true,
  17. badge: true,
  18. sound: true
  19. },
  20. popInitialNotification: true,
  21.  
  22. requestPermissions: true
  23. });
  24.  
  25.  
  26. PushNotification.localNotificationSchedule({
  27. id:212,
  28. message: 'Deneme',
  29. date: new Date(Date.now() + 1 * 1000),
  30. repeatType: 'minute',
  31. });
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement