Skip to content

[Release] v0.4.1 - Integration / Beta Branch #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
May 5, 2021
Merged

Conversation

fbartho
Copy link
Contributor

@fbartho fbartho commented Oct 28, 2020

-- Change PRs are enumerated in the tracking milestone

Changes

@kittichanr
Copy link

I have tried push notification this version. it's work in android but ios not working. How can I fix it ?

please help.

@gabrielperales
Copy link
Contributor

@petchkubb can you try to add this to your AppDelegate.m:

#import <RNCPushNotificationIOS.h>
#import <ChatProvidersSDK/ChatProvidersSDK.h>


- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
  [ZDKChat registerPushToken:deviceToken];
  [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}

Regards

@gabrielperales
Copy link
Contributor

gabrielperales commented Nov 20, 2020

@fbartho I think @petchkubb is right, if I don't add the code I posted before I'm not getting the push notifications. Maybe the token conversion from NSString to NSData is wrong?

RCT_EXPORT_METHOD(registerPushToken:(NSString *)token) {
	dispatch_sync(dispatch_get_main_queue(), ^{
		[ZDKChat registerPushToken:[RCTConvert NSData:token]];
	});
}

@fbartho
Copy link
Contributor Author

fbartho commented Nov 20, 2020

@gabrielperales / @petchkubb -- Have you added log messages to prove you called the registerPushToken API from the JS side of things?

I'm happy to try other ways of converting an NSString to an NSData. [NSData dataWithString: token] comes to mind. Have you tested that one?

@gabrielperales
Copy link
Contributor

@fbartho No, I haven't. I don't know too much about Objective-C... so when I made it work with the snipped I posted above... I stopped searching for other ways to make it work.

@@ -282,10 +342,38 @@ public void startChat(ReadableMap options) {

@ReactMethod
public void registerPushToken(String token) {
PushNotificationsProvider pushProvider = Chat.INSTANCE.providers().pushNotificationProvider();
PushNotificationsProvider pushProvider = Chat.INSTANCE.providers().pushNotificationsProvider();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this update right? I got the code from the docs and is says that the method is pushNotificationProvider() without the s.

PushNotificationsProvider pushProvider = Chat.INSTANCE.providers().pushNotificationProvider();

if (pushProvider != null) {
    pushProvider.registerPushToken("YOUR FIREBASE TOKEN");
}

Copy link
Contributor

@gabrielperales gabrielperales Nov 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I just checked it and it's alright.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's works thank you @gabrielperales

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad you make it work @petchkubb 👍 . It was working for you in android? I'm not able to receive push notifications from the chat in my android App. Did you configure something I could be missing or something?

@gabrielperales
Copy link
Contributor

@gabrielperales / @petchkubb -- Have you added log messages to prove you called the registerPushToken API from the JS side of things?

I'm happy to try other ways of converting an NSString to an NSData. [NSData dataWithString: token] comes to mind. Have you tested that one?

I'm checking that there is another method called registerPushTokenString which receives the string so we shouldn't have to convert it. I'm going to try with that.

@gabrielperales
Copy link
Contributor

@fbartho I changed registerPushToken for registerPushTokenString and I can confirm that it works :)

@breadadams
Copy link

@petchkubb did you have to follow any extra steps to get things working on Android?

acarpe and others added 3 commits December 3, 2020 09:58
This fix the following compilation error I have on the release/0.4.1 branch:
/Users/my-user/work/my-app/node_modules/react-native-zendesk-chat/android/src/main/java/com/taskrabbit/zendesk/RNZendeskChatModule.java:146: error: cannot find symbol
            & ApplicationInfo.FLAG_DEBUGGABLE) == 0)) {
              ^
  symbol:   variable ApplicationInfo
  location: class RNZendeskChatModule
fix: added import to fix compilation error
fbartho and others added 8 commits December 4, 2020 22:19
Use same init wrapper on iOS as Android to handle optional param
switched registerPushToken by registerPushTokenString on ios
Added Obtaining the YOUR_ZENDESK_ACCOUNT_KEY  section to readme
Necessary for calling [ZDKChat registerPushTokenWithString: ...]
@fbartho
Copy link
Contributor Author

fbartho commented Jan 21, 2021

v0.4.1-beta.7 is ready for anybody watching this PR!

@fbartho fbartho mentioned this pull request May 5, 2021
@fbartho fbartho merged commit 87c1148 into main May 5, 2021
@fbartho fbartho deleted the release/v0.4.1 branch May 5, 2021 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants