-6

如何向用户发送包含时间和日期的通知?用户完成预约后,它将向用户发送通知,让用户知道日期和时间。任何人都可以帮助我

这是我在 firebase 中存储的日期和时间数据 在此处输入图像描述

私有 TextView mDate;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_user_information);
    mDate = (TextView) findViewById(R.id.tvdate);

    //declare the database reference object. This is what we use to access the database.
    //NOTE: Unless you are signed in, this will not be useable.
    mAuth = FirebaseAuth.getInstance();
    mFirebaseDatabase = FirebaseDatabase.getInstance();
    myRef = mFirebaseDatabase.getReference();
    buttonBack = (Button) findViewById(R.id.btnBack);
    final FirebaseUser user = mAuth.getCurrentUser();
    userID = user.getUid();


    buttonBack.setOnClickListener(this);


    // Read from the database
    myRef.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            mDate.setText(dataSnapshot.child(userID).child("Appointment").child("date").getValue(String.class));

        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });
}
4

1 回答 1

0

您需要阅读Firebase Cloud Messaging for Android

如果您想管理数据,请阅读云功能

于 2017-09-19T09:57:39.067 回答