urbanairship / airship-flutter

Flutter integration
Other
17 stars 17 forks source link

iOS not work #3

Closed viniciusfragelli closed 5 years ago

viniciusfragelli commented 5 years ago

Hi,

I'm having difficulty to make the Push Notifications to work on iOS, did all the configurations on Apple Developer and also on Firebase, add the Push Certificate (.p12) in the Channels in your platform, try to send the push and nothing happens. If i try to use the Firebase, the app receives with success, but on your platform, no. Already tried to use the Project Live and Project Test, with both developer and production certificates, and nothing happens. I found awkward that your platform sees the app was open with success, but won't deliver the Push Notification.

Here's the git of my project: https://github.com/viniciusfragelli/FlutterUrbanTest

Best Regards, Vinicius

viniciusfragelli commented 5 years ago

On the previous issue, i've report a bug that couldn't find that on the class. I check the last commit and saw that you only comment one full class, is that right? I also had to comment the follow code to make the build to compile.

image

rlepinski commented 5 years ago

Could you provide logs and your pod lock file?

viniciusfragelli commented 5 years ago

Pod install logs:

Analyzing dependencies Fetching podspec for Flutter from .symlinks/flutter/ios Fetching podspec for airship from .symlinks/plugins/airship/ios Downloading dependencies Using Firebase (6.2.0) Using FirebaseAnalytics (6.0.1) Using FirebaseAnalyticsInterop (1.2.0) Using FirebaseCore (6.0.2) Using FirebaseInstanceID (4.1.1) Using FirebaseMessaging (4.0.2) Using Flutter (1.0.0) Using GoogleAppMeasurement (6.0.1) Using GoogleUtilities (6.2.0) Using Protobuf (3.8.0) Using UrbanAirship-iOS-AppExtensions (11.0.0) Using UrbanAirship-iOS-SDK (11.0.0) Using airship (0.0.1) Using nanopb (0.3.901) Generating Pods project Integrating client project Pod installation complete! There are 5 dependencies from the Podfile and 14 total pods installed.

[!] Automatically assigning platform ios with version 10.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target Runner to Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig or include the Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build configuration (Flutter/Release.xcconfig).

Pod lock:

https://github.com/viniciusfragelli/FlutterUrbanTest/blob/master/ios/Podfile.lock

Logs App in xcode:

2019-06-06 13:38:27.855235-0300 Runner[451:100355] [I] +[UAirship executeUnsafeTakeOff:] [Line 205] UAirship Take Off! Lib Version: 11.0.0 App Key: BNiPV2UoQo-57IVRMeGN9Q Production: NO. 2019-06-06 13:38:27.872754-0300 Runner[451:100355] [E] -[UAActionRegistry registerDefaultActions] [Line 384] Missing predicate class: UALandingPageActionPredicate 2019-06-06 13:38:27.880177-0300 Runner[451:100355] Channel ID: 29148d67-f354-4eb5-916c-a19bfb0bbaa6 2019-06-06 13:38:27.931872-0300 Runner[451:100355] [D] -[UANamedUser update] [Line 59] New or re-install, skipping named user update. CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/2A19A61A-C4A8-4174-92A3-0D9D0CD64CCC/Runner.app/Frameworks/AirshipKit.framework/AirshipResources.bundle/UAAutomation.momd/UAAutomation 5.omo' 2019-06-06 13:38:27.990318-0300 Runner[451:100355] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 548] Updating triggers with type: 7 CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/2A19A61A-C4A8-4174-92A3-0D9D0CD64CCC/Runner.app/Frameworks/AirshipKit.framework/AirshipResources.bundle/UARemoteData.momd/UARemoteData 2.omo' CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/2A19A61A-C4A8-4174-92A3-0D9D0CD64CCC/Runner.app/Frameworks/AirshipKit.framework/AirshipResources.bundle/UAAutomation.momd/UAAutomation 5.omo' 2019-06-06 13:38:28.104272-0300 Runner[451:100355] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 548] Updating triggers with type: 7 2019-06-06 13:38:28.139694-0300 Runner[451:100355] [I] +[UAirship executeUnsafeTakeOff:] [Line 277] Automatic setup enabled. 2019-06-06 13:38:28.365554-0300 Runner[451:100355] [D] -[UAConfig setValue:forUndefinedKey:] [Line 435] Ignoring invalid UAConfig key: useWKWebView 2019-06-06 13:38:28.620856-0300 Runner[451:100355] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 548] Updating triggers with type: 0 2019-06-06 13:38:28.622186-0300 Runner[451:100355] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 548] Updating triggers with type: 8 2019-06-06 13:38:28.627012-0300 Runner[451:100355] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 548] Updating triggers with type: 0 2019-06-06 13:38:28.627771-0300 Runner[451:100355] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 548] Updating triggers with type: 8 2019-06-06 13:38:28.635622-0300 Runner[451:100355] [D] -[UAInboxMessageList retrieveMessageListWithSuccessBlock:withFailureBlock:] [Line 136] Retrieving message list. 2019-06-06 13:38:28.667002-0300 Runner[451:100355] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2019-06-06 13:38:28.670789-0300 Runner[451:100355] [MC] Reading from public effective user settings. 2019-06-06 13:38:29.456392-0300 Runner[451:100411] flutter: Observatory listening on http://127.0.0.1:51150/_GQVutLShjQ=/ 2019-06-06 13:38:29.818539-0300 Runner[451:100355] [I] +[UAAppIntegration application:didRegisterForRemoteNotificationsWithDeviceToken:] [Line 45] Application registered device token: 45f82dcde0b567988486aeb418f7f999cd4d57a59ac25cce9aa5e4b143b4b1ff 2019-06-06 13:38:29.819280-0300 Runner[451:100355] Device token: 45f82dcde0b567988486aeb418f7f999cd4d57a59ac25cce9aa5e4b143b4b1ff 2019-06-06 13:38:29.822058-0300 Runner[451:100355] [D] -[UAInboxMessageList refreshInboxWithCompletionHandler:]_block_invoke_2 [Line 348] Inbox messages updated. 2019-06-06 13:38:29.822841-0300 Runner[451:100355] [I] +[UAAppIntegration application:didRegisterForRemoteNotificationsWithDeviceToken:] [Line 45] Application registered device token: 45f82dcde0b567988486aeb418f7f999cd4d57a59ac25cce9aa5e4b143b4b1ff 2019-06-06 13:38:29.823533-0300 Runner[451:100355] Device token: 45f82dcde0b567988486aeb418f7f999cd4d57a59ac25cce9aa5e4b143b4b1ff 2019-06-06 13:38:29.824829-0300 Runner[451:100355] [D] -[UAAnalytics addEvent:]_block_invoke [Line 206] Adding app_init event 103BDB5B-F323-43AE-92C1-A03D38D58829. 2019-06-06 13:38:29.845618-0300 Runner[451:100355] [D] -[UAPush updateRegistration] [Line 743] APNS registration is out of date, updating. 2019-06-06 13:38:29.965380-0300 Runner[451:100355] [D] -[UAAnalytics addEvent:]_block_invoke [Line 206] Adding device_registration event 93E400AC-036A-4091-9255-C3635B368BE7. 2019-06-06 13:38:29.969145-0300 Runner[451:100355] [D] -[UAAnalytics addEvent:]_block_invoke [Line 206] Adding device_registration event 199C85E8-2592-4068-863C-A1D3C8A730F3.

rlepinski commented 5 years ago

The build failure is because its using SDK 11 and not 10.2.2. I must of specified the spec wrong. Either way push should be working and it looks like its generating a channel and device token.

Could you look up your channel ID in the dashboard to see if its opted in 29148d67-f354-4eb5-916c-a19bfb0bbaa6. When you started the app, did you get prompted to accept notifications?

Are you testing it in a simulator or on a real device? Simulators do not support push notifications.

rlepinski commented 5 years ago

Pushed a fix to make it compatible with SDK 11.0

viniciusfragelli commented 5 years ago

Yes, when i open the app, it requests the push permission. Change the podlock to the SDK 10.2.2, ran the test and still didn't work. Removed the UrbanAirship-iOS-AppExtensions, but still didn't work.

Here's the Podlock:

https://github.com/viniciusfragelli/FlutterUrbanTest/blob/master/ios/Podfile.lock

Here's the logs on pod install:

Analyzing dependencies Fetching podspec for Flutter from .symlinks/flutter/ios Fetching podspec for airship from .symlinks/plugins/airship/ios Downloading dependencies Using Firebase (6.2.0) Using FirebaseAnalytics (6.0.1) Using FirebaseAnalyticsInterop (1.2.0) Using FirebaseCore (6.0.2) Using FirebaseInstanceID (4.1.1) Using FirebaseMessaging (4.0.2) Using Flutter (1.0.0) Using GoogleAppMeasurement (6.0.1) Using GoogleUtilities (6.2.0) Using Protobuf (3.8.0) Using UrbanAirship-iOS-AppExtensions (11.0.0) Using UrbanAirship-iOS-SDK (10.2.2) Using airship (0.0.1) Using nanopb (0.3.901) Generating Pods project Integrating client project Pod installation complete! There are 5 dependencies from the Podfile and 14 total pods installed.

[!] Automatically assigning platform ios with version 10.0 on target Runner because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target Runner to Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig or include the Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build configuration (Flutter/Release.xcconfig). iMac-de-Robson:ios viniciusfragellisenff$ pod install Analyzing dependencies Fetching podspec for Flutter from .symlinks/flutter/ios Fetching podspec for airship from .symlinks/plugins/airship/ios Downloading dependencies Using Firebase (6.2.0) Using FirebaseAnalytics (6.0.1) Using FirebaseAnalyticsInterop (1.2.0) Using FirebaseCore (6.0.2) Using FirebaseInstanceID (4.1.1) Using FirebaseMessaging (4.0.2) Using Flutter (1.0.0) Using GoogleAppMeasurement (6.0.1) Using GoogleUtilities (6.2.0) Using Protobuf (3.8.0) Using UrbanAirship-iOS-SDK (10.2.2) Using airship (0.0.1) Using nanopb (0.3.901) Removing UrbanAirship-iOS-AppExtensions Generating Pods project Integrating client project Pod installation complete! There are 4 dependencies from the Podfile and 13 total pods installed.

rlepinski commented 5 years ago

I was able to get your sample app working by using my app key/secret and provisioning profile:

Screen Shot 2019-06-07 at 3 26 40 PM

Seems like the issues is somewhere with your APNS configuration

rlepinski commented 5 years ago

@viniciusfragelli Any luck? Can we close this issue?