2017-12-10 21 views
-2

도와주세요. 내 웹 사이트 용 Android 애플리케이션을 만들었습니다.알림을 설정하는 방법은 무엇입니까?

이제 내 웹 사이트에 새 콘텐츠를 업데이트/업로드 할 때 사용자에게 알리고 싶습니다. 이 * "... 추가됩니다 ..."
* "지금 체크 아웃 : 나는, 사용자가 알림을 내 위해 응용 프로그램 넣으면를 사용하고있는 내 웹 페이지에 무언가를 업데이트 할 때

내가 말을 의미한다. .. "

나는 당신이 무엇을 말하려고하는지 이해하기를 바랍니다.
나쁜 단어를위한 Sorrry

나는 웹 페이지에 새 뉴스를 추가하는 것과 같은 신문 응용 프로그램과 같습니다.
사용자가 "문제가 발생했습니다"라는 메시지가 나타납니다.

+0

seach for 'android rss feed' –

+1

알림은 큰 제목입니다. Android 응용 프로그램에 대해 검색하고 구현 방법을 확인해야합니다. 그런 다음 구체적인 질문이 있으면 여기로 도움을 요청하십시오. –

답변

0

Firebase와 같은 푸시 알림 기능을 사용할 수 있습니다. 여기에서 시작하는 링크가 here

+0

덕분에 김 많은 ... –

+0

좋아 덕분에 내가 알고 있지만 그 때마다 내가 알림 을 보내야하지만 알고 와나 어떤 식 으로든 .... 그래서 통지가 자동으로 전송이 그것을 –

1

가장 쉬운 해결책은 응용 프로그램에 Firebase를 추가하는 것입니다.

그러면 Firebase Cloud Messaging Service이 필요합니다. 당신이 당신의 중포 기지 대시 보드에 알림 패널로 이동하는 경우, 특정 인스턴트 알림을 보낼 수

public class NotificationService extends FirebaseMessagingService { 

    @Override public void onMessageReceived(RemoteMessage remoteMessage) { 
    super.onMessageReceived(remoteMessage); 

    Timber.d("Message received [" + remoteMessage + "]"); 

    Intent intent = new Intent(this, MainActivity.class); 
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
    PendingIntent pendingIntent = 
     PendingIntent.getActivity(this, 1410, intent, PendingIntent.FLAG_ONE_SHOT); 

    NotificationCompat.Builder notificationBuilder = 
     new NotificationCompat.Builder(this).setSmallIcon(R.drawable.logo) 
      .setContentTitle("Notification!") 
      .setContentText(remoteMessage.getNotification().getBody()) 
      .setAutoCancel(true) 
      .setContentIntent(pendingIntent); 

    NotificationManager notificationManager = 
     (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 

    if (notificationManager != null) { 
     notificationManager.notify(1410, notificationBuilder.build()); 
    } 
    } 
} 

compile 'com.google.firebase:firebase-messaging:11.6.2' 

는 서비스 매니페스트

<service 
     android:name=".model.notifications.NotificationService"> 
     <intent-filter> 
     <action android:name="com.google.firebase.MESSAGING_EVENT"/> 
     </intent-filter> 
</service> 

이 서비스를 추가하고 만들 사용자 또는 귀하의 앱을 사용하는 모든 사용자.

+0

있어 ... –

+0

내 firebase 계정에 로그인 할 때마다 다음과 같이 최종 사용자에게 알림을 보내십시오. –

+0

https://stackoverflow.com/questions/37542073/send-notification-automatically-from-firebase –