#[0]​, zap vibration improvement with UINotificationFeedbackGenerator

https://github.com/damus-io/damus/pull/776

It gave me a jolt, please review!

Reply to this note

Please Login to reply.

Discussion

I still don’t understand why it’s being done in a loop though

⚡️ I tested it with and without the loop on my real device. The loop intensifies the vibration a little bit more. Without the loop, it is just another tickle. There are two loops for a case where sats’ greater than 10,000. The parent loop periodically runs the vibration for that many times the quotient of the received amount when divided by 10,000

I don’t understand why there isn’t a single call that does a notification-like vibration.

This function call vibration_generator.notificationOccurred(.success) does the vibration. The vibration_generator is an instance of UINotificationFeedbackGenerator

these are the places when we can later on (not now) implement the in app local notifications too when zap received at foregrounded state