Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 8 Monaten
Letzter Beitrag:
vor 8 Monaten
Beteiligte Autoren:
Rik, Wim Nihoul, Harry W

Notification iOS (NotifAdd)

Startbeitrag von Rik am 13.02.2017 15:01

Hello all,

At the moment I am struggling with the function NotifAdd.
I would like to notificate the user by use of a push notification when something particular in the database (Client server) changes.

For this manner I use the function NotifAdd which should fulfill my needs.
Got it working on Android. But when I try to use it on an iOS device, no notification pops up.

This is the simplified code I use for testing:

//// Automatic Procedure:
// The procedure is run manually, during a call in the code
// It will be repeated in loop, with a timeout set to 5 seconds between each call
// A new timer is created whenever the procedure is called

PROCEDURE GprPushNotification()
IF BellerAantal < HNbRec(F_beller) THEN
BellerAantal = HNbRec(F_beller)
notif is Notification
notif..Message = "Gebeld"
NotifAdd(notif)
END


Am I doing something wrong/forgetting something?

Regards,
Rik

Antworten:

Hello Rik,

I think you have to do a Hread on F_Beller just before HNbRec ?
Something like HRead(F_Beller,CurrentRecNum)

von Harry W - am 13.02.2017 15:47
Hello Harry,

Thank you for your fast response!
The problem is not in the IF function.

Because when I add an info around the NotifAdd function it will produce a 1 (info(NotifAdd(notif)). Which seems rather strange as it won't pop up.
And on Android this piece of code works fine.

Regards,
Rik

von Rik - am 13.02.2017 15:52
Hi Rik,

Do you run this procedure in a thread?

Wim

von Wim Nihoul - am 17.02.2017 09:38
Hi Wim,

I use a Timer/Scheduled procedure with the following properties:
- Number of times: Infinite
- Every 5 seconds
- Add an additional timer

Rik

von Rik - am 17.02.2017 13:37
ok,

I just asked about the thread, because then you could try

PROCEDURE GprPushNotification()
IF BellerAantal < HNbRec(F_beller) THEN
BellerAantal = HNbRec(F_beller)
ExecuteMainThread(MyNotifAdd,"Gebeld")
END

// new (global) procedure:

PROCEDURE MyNotifAdd(MyMessage is string)
notif is Notification
notif..Message = MyMessage
NotifAdd(notif)

Regards,
Wim

von Wim Nihoul - am 17.02.2017 15:14
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.