Bonjour,
Je voudrais savoir s'il vous plait si il existe un moyen d’arrêter l'envoie de notifications avec la méthode push lorsque j'appelle une méthode.
Code:
1
2
3 public String arreterPush(){ //Arreter le push }
Merci.
Version imprimable
Bonjour,
Je voudrais savoir s'il vous plait si il existe un moyen d’arrêter l'envoie de notifications avec la méthode push lorsque j'appelle une méthode.
Code:
1
2
3 public String arreterPush(){ //Arreter le push }
Merci.
bonjour,
c'est toi qui lance le push, donc a toi de tester si tu dois le lancer :
la variable doPush ne se trouve pas forcement dans le bean, cela dépend du scope de celui ci.Code:
1
2
3
4
5
6
7
8
9 public String arreterPush(){ doPush = false; } public void recommand() { if (doPush) { PushContext pushContext = PushContextFactory.getDefault().getPushContext(); pushContext.push("/notifications", null); } }
Non l’arrêt ne marche pas par contre toujours il affiche les notifications
j'ai fait ceci lorsque je veux appeler la méthode exécuterCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 private boolean dopush = true ; public boolean isDopush() { return dopush; } public void setDopush(boolean dopush) { this.dopush = dopush; } public String arreter(){ dopush = false; return "success"; }