Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

fsales_123

Bom dia galera preciso de uma ajuda de vcs

Recommended Posts

Bom dia galera, fiz um protótipo de notificação esta funcionando tudo certinho, o que eu não sei fazer é como é mostrar o TEXTO e TITULO da notificação...

Alguém pode me ajuda, como fazer isso.. código abaixo:

 

public class FcmMessagingService extends FirebaseMessagingService {
    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        String title = remoteMessage.getNotification().getTitle();
        String message = remoteMessage.getNotification().getBody();
        String click_action = remoteMessage.getNotification().getClickAction();

        Intent intent = new Intent(click_action);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        PendingIntent pendingIntent = PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_ONE_SHOT);
        NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);
        notificationBuilder.setContentTitle(title);
        notificationBuilder.setContentText(message);
        notificationBuilder.setSmallIcon(R.mipmap.ic_launcher);
        notificationBuilder.setAutoCancel(true);
        notificationBuilder.setContentIntent(pendingIntent);
        NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        notificationManager.notify(0,notificationBuilder.build());

    }
}

Queria mostrar esse TITLE e o MESSAGE, quando a pessoa clicar na notificação ele armazena e ela abre e consegue le o que está escrito..

vlw galera

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por ILR master
      Pessoal, pergunta bem simples. Abaixo tenho o seguinte código:
       
      <script>
      function alerta()
      {
        if (window.confirm("Você realmente quer sair?")) {
          window.open("sair.html");
      }
      }
      </script>
       
      Funciona perfeitamente, só que está abrindo em outra janela e quero que abra na mesma janela.
       
      Alguém pode me ajudar?
    • Por Jack Oliveira
      Ola pessoal boa tarde
      estou tentando fazer um texto se mover dentro do input porem nao esta dando resultado que preciso
       
      Este é o codigo 
      <script type="text/javascript"> $(document).ready(function () { var frases = [{ 'elemento': $('input[name=search_string]'), 'frases': ["O que você está procurando?", "Buscar por: Academia, Barbearia, Churrascaria, Decoração, Escola, Farmácia, Gráfica, Imobiliaria, Lanchonete, Mecânica, Odontologia, Pizzaria...", "Faça sua busca por segmentos aqui.", "São mais de 3mil empresas para serem exploradas."] }]; animaInput(frases); }); </script>  
    • Por Rengavitp
      Boa noite pessoal!
       
      Estou fazendo um projeto web com spring boot e é a primeira vez que lido com imagens. Minha idéia é salvar imagens em uma pasta e depois recuperar essa imagem e mostrar, mas o problema que estou enfrentando é o seguinte, seu eu envio para o src do projeto na pasta imagens, eu até consigo acessar as imagens, mas preciso atualizar o projeto na IDE (isso vai acontecer em produção?) eu tentei salvar em uma pasta fora do source do projeto mas ai não consigo acessar. como devo fazer? fiz várias pesquisas, mas nenhuma me ajudou.
       
      Desde já agradeço.
    • Por Rengavitp
      Bom dia pessoal!

      Estou com o seguinte problema, tenho uma aplicação que funciona perfeitamente rodando na minha IDE (Spring Tool Suite) mas ao gerar o arquivo war e subir a aplicação no tom cat ele não funciona, mas apenas erro 404, abri o war e todos os arquivo estão lá, já tem seguir tudo quando e tutorial com problemas semelhantes mas nenhum resolveu. Abaixo mais informações,.

      Versão do java na aplicacao 11
      Versão do jva no servidor 11
      Versão do tomcat no servidor 8.5.55
       
      minha classe principal
      package br.com.masterplastfitas; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication public class MasterApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(MasterApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(MasterApplication.class); } } meu pom.xml
      <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.2</version> <relativePath /> <!-- lookup parent from repository --> </parent> <groupId>masterplast</groupId> <artifactId>Master</artifactId> <version>2.0</version> <packaging>war</packaging> <name>Master</name> <description>Aplicação web </description> <properties> <java.version>11</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity5</artifactId> </dependency> <dependency> <groupId>org.mindrot</groupId> <artifactId>jbcrypt</artifactId> <version>0.4</version> </dependency> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.0</version> </dependency> </dependencies> <build> <plugins> <!-- <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> --> </plugins> </build> </project>  
    • Por Stephhany909
      While trying to persist an object with an attribute of type Point, defined as follows:
       
      @Entity @Table(name = "event") public class Event { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private long id; @Column(columnDefinition = "POINT") private Point coordinate; } I'm getting the error Data truncation: Cannot get geometry object from data you send to the GEOMETRY field.
      The corresponding database table is defined as follows:
       
      create table event ( id bigint not null auto_increment, coordinate POINT, primary key (id) ) engine= InnoDB; What am I missing?
       
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.