Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
- Loading branch information
Showing
10 changed files
with
93 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
package core | ||
|
||
import ( | ||
"fmt" | ||
|
||
"berty.tech/core/pkg/notification" | ||
) | ||
|
||
// nativeNotificationModule is a notification.Driver | ||
var _ notification.Driver = (*nativeNotificationModule)(nil) | ||
// MobileNotification is a notification.Driver | ||
var _ notification.Driver = (*MobileNotification)(nil) | ||
|
||
type nativeNotificationModule struct { | ||
type MobileNotification struct { | ||
NativeNotification | ||
} | ||
|
||
func (n nativeNotificationModule) DisplayNotification(p notification.Payload) error { | ||
return n.NativeNotification.DisplayNativeNotification(p.Title, p.Body, p.Icon, p.Sound) | ||
func (n *MobileNotification) DisplayNotification(p notification.Payload) error { | ||
return n.NativeNotification.DisplayNotification(p.Title, p.Body, p.Icon, p.Sound) | ||
} | ||
|
||
func (n *MobileNotification) ReceiveNotification(data string) { | ||
logger().Debug(fmt.Sprintf("Receive notification: %+v", data)) | ||
} | ||
|
||
// TODO: change pushIDType to enum and see if it build well with gomobile | ||
func (n *MobileNotification) ReceivePushID(pushID, pushIDType string) { | ||
logger().Debug(fmt.Sprintf("Receive push id from %v: %+v", pushIDType, pushID)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters