Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Notification subscribe crash app on build 2019.3512
Started by lelinhit09 Aug 08 2019 12:53 AM

5 replies to this topic
notification subscribe 2019.3512 notifications.subscribe() crash app
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

lelinhit09

[GLOBAL: userInfoPane.html]
lelinhit09
  • Observer

  • 10 posts
  • Corona SDK

Currently my application is working great on the build 2018.3326. But when I build with 2019.3512, then crash app at notifications.subscribe(). Please help me!



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,394 posts
  • Enterprise

Can you provide more details?

 

Share the section of code?

Share the console.log from the device (you may need to an "adb logcat" to capture it). Please use a service like pastebin.com for long logs.

Share your build.settings (again pastebin.com is your friend here if you have a long build.settings).

 

Thanks

Rob



[TOPIC: post.html]
#3

david79

[GLOBAL: userInfoPane.html]
david79
  • Observer

  • 21 posts
  • Corona SDK

I have the same issue on iOS (haven't tested on Android), where the app crashes as soon as the notifications popup appears on the latest daily build at this time (3517), and every thing works fine on 3332. I'll get a log as soon as I can :) 



[TOPIC: post.html]
#4

lelinhit09

[GLOBAL: userInfoPane.html]
lelinhit09
  • Observer

  • 10 posts
  • Corona SDK

This is my logcat error
 
-----------------Logcat error-------------------
--------- beginning of crash
2019-09-12 08:26:34.054 13985-13985/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: piano.tiles.duongcam, PID: 13985
    java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String;)V in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /data/app/piano.tiles.duongcam-eBi_fd9-ZlGUHe8zntsF6w==/base.apk)
        at plugin.notifications.v2.LuaLoader$Subscribe$1.run(LuaLoader.java:352)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:7000)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
---------------------------------


[TOPIC: post.html]
#5

lelinhit09

[GLOBAL: userInfoPane.html]
lelinhit09
  • Observer

  • 10 posts
  • Corona SDK

This is the code I use for notifications

 

main.lua

local notifications = require( "plugin.notifications.v2" )
notifications.registerForPushNotifications({useFCM=true})

notifications.subscribe("com.myapp")

build.settings

settings = {
    splashScreen = {
        enable = false,
    },
	orientation = {
        default = "portrait",   --landscapeRight, landscapeLeft, portrait, portraitUpsideDown
        supported = { "portrait", "portraitUpsideDown"}
    },
	plugins = {
        --Facebook
        ["plugin.facebook.v4a"] =
        {
			publisherId = "com.coronalabs",
			supportedPlatforms = { android=true, iphone=true }
		},
        --Ads
        ["plugin.admob"] =
        {
            publisherId = "com.coronalabs",
			supportedPlatforms = { iphone=true, android=true }
        },
		["plugin.unityads"] =
        {
            publisherId = "com.coronalabs",
			supportedPlatforms = { iphone=true, android=true }
        },
        --Notifications
		["plugin.notifications.v2"] =
        {
            publisherId = "com.coronalabs",
			supportedPlatforms = { iphone=true, android=true }
        },
        --Analytics
		["plugin.googleAnalytics"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },
		["plugin.firebaseAnalytics"] = {
            publisherId = "tech.scotth",
            supportedPlatforms = { iphone=true, android=true }
        },
		--In-app google play
		["plugin.google.iap.v3"] =
        {
            publisherId = "com.coronalabs",
			supportedPlatforms = { android=true }
        },
	},
    android = {
		facebookAppId = "xxxxxxxxxxxxx",
        usesPermissions =
        {
			"android.permission.INTERNET",
			"android.permission.READ_EXTERNAL_STORAGE",
			"android.permission.WRITE_EXTERNAL_STORAGE",
			"android.permission.ACCESS_NETWORK_STATE",
			"android.permission.ACCESS_WIFI_STATE",
			"com.android.vending.BILLING",
        },
        installLocation = "auto",
		useGoogleServicesJson = true,
		strings =
		{
		    ["google_app_id"]= "xxxxxxxxxxxxxxxxxxxx"
		},
		applicationChildElements =
        {
            -- Array of strings
            [[
                <meta-data android:name="android.max_aspect" android:value="2.1"/>
            ]],
            [[
				<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
                    android:value="xxxxxxxxxxxxxxxxxxxx"/>
            ]],
        },
		intentFilters =
        {
            {
                actions = { "android.intent.action.VIEW" },
                categories =
                {
                    "android.intent.category.DEFAULT",
                    "android.intent.category.BROWSABLE",
                },
                --Previous scheme below
                data =
                {
                    scheme = "com.myapp",
                },
            },
			{
                actions = { "android.intent.action.LAUNCHER" },
                categories =
                {
                    "android.intent.category.DEFAULT",
                },

                data =
                {
                    scheme = "com.myapp",
                },
            },
		}
    },
}



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,394 posts
  • Enterprise

Do you have multiple categories setup in your FCM server side?

 

Does your app really need to use categories? 

 

What version of Corona are you using?

 

Rob




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: notification, subscribe, 2019.3512, notifications.subscribe(), crash app