Skip to content

Commit

Permalink
Fixing some formatting and missed name change
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed May 4, 2020
1 parent c68c412 commit 1459c4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/app_darwin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestEscapeNotifyString(t *testing.T) {
func TestEscapeNotificationString(t *testing.T) {
assert.Equal(t, "normal", escapeNotificationString("normal"))
assert.Equal(t, "isn't", escapeNotificationString("isn't"))
assert.Equal(t, `\"mine\"`, escapeNotificationString(`"mine"`))
Expand Down
14 changes: 7 additions & 7 deletions app/app_mobile_and.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ void sendNotification(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char
(*env)->CallObjectMethod(env, builder, setContentTitle, titleStr);

jmethodID setContentText = find_method(env, cls, "setContentText", "(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;");
(*env)->CallObjectMethod(env, builder, setContentText, bodyStr);
(*env)->CallObjectMethod(env, builder, setContentText, bodyStr);

int iconID = 17629184; // constant of "unknown app icon"
int iconID = 17629184; // constant of "unknown app icon"
jmethodID setSmallIcon = find_method(env, cls, "setSmallIcon", "(I)Landroid/app/Notification$Builder;");
(*env)->CallObjectMethod(env, builder, setSmallIcon, iconID);
(*env)->CallObjectMethod(env, builder, setSmallIcon, iconID);

jmethodID build = find_method(env, cls, "build", "()Landroid/app/Notification;");
jobject notif = (*env)->CallObjectMethod(env, builder, build);
jobject notif = (*env)->CallObjectMethod(env, builder, build);

jclass mgrCls = find_class(env, "android/app/NotificationManager");
jobject mgr = getSystemService(env, ctx, "notification");
jobject mgr = getSystemService(env, ctx, "notification");

jmethodID notify = find_method(env, mgrCls, "notify", "(ILandroid/app/Notification;)V");
(*env)->CallVoidMethod(env, mgr, notify, nextId, notif);
nextId++;
(*env)->CallVoidMethod(env, mgr, notify, nextId, notif);
nextId++;
}
2 changes: 1 addition & 1 deletion app/app_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestEscapeNotifyString(t *testing.T) {
func TestEscapeNotificationString(t *testing.T) {
assert.Equal(t, "normal", escapeNotificationString("normal"))
assert.Equal(t, "isn't", escapeNotificationString("isn't"))
assert.Equal(t, "`\"mine`\"", escapeNotificationString(`"mine"`))
Expand Down

0 comments on commit 1459c4c

Please sign in to comment.