Skip to content
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

[CM-2026] Added Support for EU Servers #130

Merged
merged 3 commits into from
Apr 23, 2024
Merged

[CM-2026] Added Support for EU Servers #130

merged 3 commits into from
Apr 23, 2024

Conversation

AbhijeetRanjan308
Copy link
Contributor

@AbhijeetRanjan308 AbhijeetRanjan308 commented Apr 19, 2024

Summary

  • Added Support of changing server config.
KommunicateFlutterPlugin.setServerConfiguration("euConfiguration");
  • To use this need to add this before using any "Login as Visitor, Login User or Build conversation" in Android.
  • To use this iOS side need to add the configuration at didFinishLaunchingWithOptions and before any of these "Login as Visitor, Login User or Build conversation". (Reason: when the app is Closed and reopened at that time the server got reset to default. To overcome the issue we can add the config in AppDelegate didFinishLaunchingWithOptions .)
  • After Logout it's necessary to set server again before performing "Login as Visitor, Login User or Build conversation"
  • Updated the deprecated function in iOS.

Comment on lines 72 to 78
switch (serverConfigText) {
case "euConfiguration":
this.serverConfig = KMServerConfiguration.EUCONFIGURATION;
Kommunicate.setServerConfiguration(context, KMServerConfiguration.DEFAULTCONFIGURATION);
break;
default:
result.error(ERROR, "It only supports `euConfiguration` for now.", null);
Copy link
Contributor

Choose a reason for hiding this comment

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

add if else instead of switch..also call native function for else block as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay

@@ -157,6 +180,9 @@ public void onFailure(RegistrationResponse registrationResponse, Exception excep
try {
String appId = (String) call.arguments();
if (!TextUtils.isEmpty(appId)) {
if (serverConfig == KMServerConfiguration.EUCONFIGURATION) {
Kommunicate.setServerConfiguration(context, serverConfig);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need cover default config as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why during login we are internally setting this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed unnecessary calls of Kommunicate.setServerConfiguration.

@kandpal025 kandpal025 merged commit 1877fc9 into master Apr 23, 2024
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.

None yet

3 participants