infobip / mobile-messaging-react-native-plugin

Mobile Messaging SDK plugin for React Native projects
24 stars 4 forks source link

Empty screen and disabled input after chat opening #30

Closed irbisdev closed 2 years ago

irbisdev commented 2 years ago

Environment: Xcode 12.5.1 Cocoapods 1.10.1 Gradle 4.1.0 react-native 0.64.2 infobip-mobile-messaging-react-native-plugin 4.0.0

Initialization:

mobileMessaging.init(
  {
    applicationCode: Config.INFOBIP_APP_CODE,
    inAppChatEnabled: true,
    geofencingEnabled: false,
    ios: {
      notificationTypes: ['alert', 'badge', 'sound'],
      logging: true,
    },
  },
  () => {
    console.log('MobileMessaging started');
  },
  (error: any) => {
    console.log('MobileMessaging error: ', error);
  },
);

mobileMessaging.showChat(); works almost fine (first func call) on Android, but on IOS - empty state with disabled input.

iOS screenshot iOS_showChat
Android screenshot (first launch) Android_showChat_1
Android screenshot (next launch, immediately after the chat is closed) Android_showChat_2

<ChatView /> - don't work on Android (empty screen without input) and on IOS - empty state with disabled input:

iOS screenshot iOS_ChatView
Android screenshot Android_ChatView

iOS logs ``` 2021-07-29 12:23:22:355 [MobileMessaging] πŸ›  [MobileMessaging] Starting service (with apns registration=true)... 2021-07-29 12:23:22:359 [MobileMessaging] πŸ’¬ Unarchived nil from /Users/fredmd/Library/Developer/CoreSimulator/Devices/75F7D8F5-1490-4783-9ED4-4092B4940D71/data/Containers/Data/Application/7D0F7BEA-AFB7-40B3-AD70-F18137758D92/Library/Application Support/com.mobile-messaging.installation 2021-07-29 12:23:23:440 [MobileMessaging] πŸ›  [MMMessageHandler] starting 2021-07-29 12:23:23:440 [MobileMessaging] πŸ›  [VersionManager] started... 2021-07-29 12:23:23:441 [MobileMessaging] πŸ›  [MessagesEvictionOperation] started... 2021-07-29 12:23:23:447 [MobileMessaging] πŸ’¬ [Core Data] NO CHANGES IN ** UNNAMED ** CONTEXT - NOT SAVING 2021-07-29 12:23:23:448 [MobileMessaging] πŸ›  [MessagesEvictionOperation] finished with errors: [] 2021-07-29 12:23:23:468 [MobileMessaging] πŸ›  [DynamicBaseUrlHTTPSessionManager] Sending request: -H "User-Agent: org.cocoapods.MobileMessaging/9.1.10 reactNative 4.0.0(iOS;14.5;;iPhone Simulator;;io.samokat.timelabse;0.1;iPhone 12;;;)" \ 2021-07-29 12:23:23:470 [MobileMessaging] πŸ›  [InstallationDataService] starting 2021-07-29 12:23:23:470 [MobileMessaging] πŸ›  [UserSessionService] starts 2021-07-29 12:23:23:471 [MobileMessaging] πŸ›  [ApnsRegistrationManager] Registering... 2021-07-29 12:23:23:471 [MobileMessaging] πŸ›  [UserSessionService] starting 2021-07-29 12:23:23:475 [MobileMessaging] πŸ›  [ApnsRegistrationManager] setting healthy flag 2021-07-29 12:23:23:481 [MobileMessaging] πŸ›  [NotificationsInteractionService] starting 2021-07-29 12:23:23:482 [MobileMessaging] πŸ›  [MMInAppChatService] starting 2021-07-29 12:23:23:485 [MobileMessaging] πŸ›  [UserDataService] sync user data with server 2021-07-29 12:23:23:485 [MobileMessaging] πŸ›  [GetChatWidgetOperation] Started... 2021-07-29 12:23:23:486 [MobileMessaging] πŸ’¬ Unarchived nil from /Users/fredmd/Library/Developer/CoreSimulator/Devices/75F7D8F5-1490-4783-9ED4-4092B4940D71/data/Containers/Data/Application/7D0F7BEA-AFB7-40B3-AD70-F18137758D92/Library/Application Support/com.mobile-messaging.user 2021-07-29 12:23:23:489 [MobileMessaging] πŸ’¬ Unarchived Optional() from /Users/fredmd/Library/Developer/CoreSimulator/Devices/75F7D8F5-1490-4783-9ED4-4092B4940D71/data/Containers/Data/Application/7D0F7BEA-AFB7-40B3-AD70-F18137758D92/Library/Application Support/com.mobile-messaging.dirty-user 2021-07-29 12:23:23:492 [MobileMessaging] πŸ›  [DynamicBaseUrlHTTPSessionManager] Sending request: -H "User-Agent: org.cocoapods.MobileMessaging/9.1.10 reactNative 4.0.0(iOS;14.5;;iPhone Simulator;;io.samokat.timelabse;0.1;iPhone 12;;;)" \ 2021-07-29 12:23:23:493 [MobileMessaging] πŸ›  [MobileMessaging] Service started with subservices: ["MMMessageHandler": , "NotificationsInteractionService": , "UserSessionService": , "BaseUrlManager": , "InAppChatService": , "InstallationDataService": , "EventsService": , "UserDataService": ] 2021-07-29 12:23:23:493 [MobileMessaging] ⚠️ [UpdateUserOperation] There is no registration. Finishing... 2021-07-29 12:23:23:494 [MobileMessaging] πŸ’¬ Unarchived nil from /Users/fredmd/Library/Developer/CoreSimulator/Devices/75F7D8F5-1490-4783-9ED4-4092B4940D71/data/Containers/Data/Application/7D0F7BEA-AFB7-40B3-AD70-F18137758D92/Library/Application Support/com.mobile-messaging.dirty-installation 2021-07-29 12:23:23:495 [MobileMessaging] πŸ›  [UpdateUserOperation] finished with errors: [Error Domain=com.mobile-messaging Code=1 "The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded." UserInfo={NSLocalizedDescription=The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded.}] 2021-07-29 12:23:23:495 [MobileMessaging] πŸ›  [MobileMessaging] Retrying sending mobile originated messages... 2021-07-29 12:23:23:496 [MobileMessaging] πŸ›  [LocalMessageFetchingOperation] Retrieved 0 messages from notification extension storage. 2021-07-29 12:23:23:497 [MobileMessaging] πŸ›  [MessagePostingOperation] started... 2021-07-29 12:23:23:498 [MobileMessaging] πŸ›  [InstallationDataService] sync installation data with server... 2021-07-29 12:23:23:498 [MobileMessaging] ⚠️ [MessagePostingOperation] No registration. Finishing... 2021-07-29 12:23:23:498 [MobileMessaging] πŸ›  [MessagePostingOperation] finished with errors: [Error Domain=com.mobile-messaging Code=1 "The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded." UserInfo={NSLocalizedDescription=The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded.}] 2021-07-29 12:23:23:498 [MobileMessaging] πŸ›  [LocalMessageFetchingOperation] Retrieved 0 messages from notification center. 2021-07-29 12:23:23:498 [MobileMessaging] πŸ›  [LocalMessageFetchingOperation] finished with errors: [] 2021-07-29 12:23:23:505 [MobileMessaging] πŸ›  [SeenStatusSendingOperation] There is no non-seen meessages to send to the server. Finishing... 2021-07-29 12:23:23:505 [MobileMessaging] πŸ›  [SeenStatusSendingOperation] finished: [] 2021-07-29 12:23:23:506 [MobileMessaging] πŸ›  [MessageFetchingOperation] Starting operation... 2021-07-29 12:23:23:506 [MobileMessaging] ⚠️ [MessageFetchingOperation] No registration. Finishing... 2021-07-29 12:23:23:506 [MobileMessaging] πŸ›  [MessageFetchingOperation] finished with errors: [] 2021-07-29 12:23:23:507 [MobileMessaging] πŸ›  [MessagesSyncOperation] finished with errors: [] 2021-07-29 12:23:23:512 [MobileMessaging] ⚠️ [UpdateInstanceOperation] There is no reference registration. Aborting... 2021-07-29 12:23:23:518 [MobileMessaging] ⚠️ [CreateInstanceOperation] There is no registration data to send. Aborting... 2021-07-29 12:23:23:518 [MobileMessaging] πŸ›  [UserDataService] sync user data with server 2021-07-29 12:23:23:519 [MobileMessaging] ⚠️ [UpdateUserOperation] There is no registration. Finishing... 2021-07-29 12:23:23:520 [MobileMessaging] πŸ›  [UpdateUserOperation] finished with errors: [Error Domain=com.mobile-messaging Code=1 "The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded." UserInfo={NSLocalizedDescription=The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded.}] 2021-07-29 12:23:23:836 [MobileMessaging] πŸ›  [DynamicBaseUrlHTTPSessionManager] Response received 2021-07-29 12:23:23:839 [MobileMessaging] ‼️ [VersionManager] An error occurred while trying to validate library version: MobileMessaging.AFError.responseValidationFailed(reason: MobileMessaging.AFError.ResponseValidationFailureReason.unacceptableStatusCode(code: 403)) 2021-07-29 12:23:23:950 [MobileMessaging] πŸ›  [DynamicBaseUrlHTTPSessionManager] Response received 2021-07-29 12:23:23:952 [MobileMessaging] πŸ›  [GetChatWidgetOperation] finished with errors: [] 2021-07-29 12:23:23:956 [MobileMessaging] πŸ›  [GetChatWidgetOperation] Started... 2021-07-29 12:23:23:977 [MobileMessaging] πŸ›  [DynamicBaseUrlHTTPSessionManager] Sending request: -H "User-Agent: org.cocoapods.MobileMessaging/9.1.10 reactNative 4.0.0(iOS;14.5;;iPhone Simulator;;io.samokat.timelabse;0.1;iPhone 12;;;)" \ 2021-07-29 12:23:24:048 [MobileMessaging] πŸ›  [DynamicBaseUrlHTTPSessionManager] Response received 2021-07-29 12:23:24:048 [MobileMessaging] πŸ›  [GetChatWidgetOperation] finished with errors: [] 2021-07-29 12:23:28:471 [MobileMessaging] πŸ›  [UserSessionService] no push registration id. Aborting... 2021-07-29 12:23:33:471 [MobileMessaging] πŸ›  [UserSessionService] no push registration id. Aborting... 2021-07-29 12:23:33:927 [MobileMessaging] πŸ›  [UserDataService] saving ["middleName": Optional("Π˜Π²Π°Π½ΠΎΠ²ΠΈΡ‡"), "emails": nil, "installations": nil, "birthday": nil, "gender": nil, "customAttributes": nil, "externalUserId": Optional("557bedca-2c2c-4624-9b5a-6a7f47e0fd6a"), "firstName": Optional("Π€Ρ‘Π΄ΠΎΡ€"), "tags": nil, "phones": Optional(["+7 373 000-00-04"]), "lastName": Optional("ΠœΠΎΡ€ΠΎΠ·ΠΎΠ²")] 2021-07-29 12:23:33:927 [MobileMessaging] πŸ’¬ Archiving at /Users/fredmd/Library/Developer/CoreSimulator/Devices/75F7D8F5-1490-4783-9ED4-4092B4940D71/data/Containers/Data/Application/7D0F7BEA-AFB7-40B3-AD70-F18137758D92/Library/Application Support/com.mobile-messaging.dirty-user 2021-07-29 12:23:33:928 [MobileMessaging] πŸ›  [UserDataService] sync user data with server 2021-07-29 12:23:33:929 [MobileMessaging] ⚠️ [UpdateUserOperation] There is no registration. Finishing... 2021-07-29 12:23:33:930 [MobileMessaging] πŸ›  [UpdateUserOperation] finished with errors: [Error Domain=com.mobile-messaging Code=1 "The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded." UserInfo={NSLocalizedDescription=The application instance is not registered on the server yet. The registration will be perfomed eventually. Subscribe to the notification `MMRegistrationUpdated` to be notified as the registration succeeded.}] 2021-07-29 12:23:38:471 [MobileMessaging] πŸ›  [UserSessionService] no push registration id. Aborting... ```

What am I doing wrong or missing?

riskpp commented 2 years ago

Hi @irbisdev, thank you for reporting it, we will check and return with the answer ASAP.

BR, Olga

riskpp commented 2 years ago

Hi @irbisdev, regarding issue with empty chat with disabled controls on iOS, I see from logs that you are testing it on Simulator, but to register your device in Infobip platform( so that it will be able to have In-app chat) we need to receive APNS token, which isn't possible on Simulator, so please check it on the device.

Regarding other questions, I'm in progress with it.

BR, Olga

irbisdev commented 2 years ago

@riskpp

Thanks for the advice. I checked it works fine on the iOS device.

riskpp commented 2 years ago

I checked other things

  1. mobileMessaging.showChat() shows empty chat on Android 2nd launch can't reproduce such behaviour, could you may be try again, mb was some temporary issue.
  2. <ChatView /> - doesn't work on Android yes, reproduced it in Example app, somehow ChatView can't get parent view, mb this behaviour connected with Navigation component, which is used in Example, will investigate it further. But it works like this:
    render() {
    return (
      <SafeAreaView style={{flex: 1}}>
        <Text style={{backgroundColor: Colors.primary}}>Chat title</Text>
        <ChatView style={{flex: 1}} sendButtonColor={'#FF0000'} />
      </SafeAreaView>
    );
    }
riskpp commented 2 years ago

Hello @irbisdev, yesterday we fixed ChatView React.Component for Android, you can use it with Navigation component as in Example app.

BR, Olga

irbisdev commented 2 years ago

@riskpp Thanks. It work now on Android