Skip to content

Commit

Permalink
1.1.9
Browse files Browse the repository at this point in the history
compatible with networking 1.5.0
  • Loading branch information
A.Badakhshan committed Oct 30, 2023
1 parent c7a237f commit 4368fb1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/src/main/java/ir/ayantech/pushnotification/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import android.widget.Toast
import ir.ayantech.pushsdk.core.AyanNotification
import ir.ayantech.pushsdk.helper.ShareHelper
import ir.ayantech.pushsdk.model.MessageDeserializer
import ir.ayantech.pushsdk.model.api.PushNotification
import ir.ayantech.pushsdk.storage.PushNotificationUser
import ir.ayantech.pushsdk.storage.PushUser
import kotlinx.android.synthetic.main.activity_main.*
import me.yokeyword.fragmentation.SupportActivity
import java.lang.Exception
Expand All @@ -23,20 +22,23 @@ class MainActivity : SupportActivity() {
}

copyBtn.setOnClickListener {
ShareHelper.copyToClipBoard(this, PushNotificationUser.getPushNotificationToken())
ShareHelper.copyToClipBoard(this, PushUser.pushNotificationToken)
Toast.makeText(this, "Copied", Toast.LENGTH_LONG).show()
}

testMessageBtn.setOnClickListener {
try {
val message = MessageDeserializer.stringToMessage("{\"actionType\":\"Share\",\"action\":{\"model\":{\"content\":\"share text\"}},\"notificationToShow\":{\"buttons\":[{\"message\":{\"action\":{\"model\":{}},\"actionType\":\"NoAction\"},\"text\":\"close\"}],\"imageUrl\":null,\"message\":\"\",\"title\":\"salam test\"}}", "")
val message = MessageDeserializer.stringToMessage(
"{\"actionType\":\"Share\",\"action\":{\"model\":{\"content\":\"share text\"}},\"notificationToShow\":{\"buttons\":[{\"message\":{\"action\":{\"model\":{}},\"actionType\":\"NoAction\"},\"text\":\"close\"}],\"imageUrl\":null,\"message\":\"\",\"title\":\"salam test\"}}",
""
)
AyanNotification.performMessageLogic(this, message)
Log.d("Msg", message.toString())
} catch (e: Exception) {
Log.e("Msg", e.message ?: "")
}
}

Log.d("TOKEN", PushNotificationUser.getPushNotificationToken())
Log.d("TOKEN", PushUser.pushNotificationToken)
}
}

0 comments on commit 4368fb1

Please sign in to comment.