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

[CIS-1900] Push Notifications - multi bundle support #2101

Merged
merged 8 commits into from
Jun 20, 2022
Merged

Conversation

bielikb
Copy link
Contributor

@bielikb bielikb commented Jun 17, 2022

🔗 Issue Links

CIS-1900

🎯 Goal

Allow integrator to leverage multi-bundle feature via exposing new parameter to addDevice API called provider name.
Provider name represents the name of the push configuration created in Stream dashboard.
Push configurations are located under Push Notifications tab in the dashboard.

Multi-bundle support allows the integrator to list multiple client apps under one Stream app in the dashboard. (eg. when leveraging Staging vs. Production setup).
The default configuration will be used if no provider name is specified.

Available API:
APN:

client?.currentUserController().addDevice(.apn(token: deviceToken, providerName: "Name of the push configuration listed in Stream's Dashboard"))

Firebase:

client?.currentUserController().addDevice(.firebase(token: deviceToken, providerName: "Name of the push configuration listed in Stream's Dashboard"))

📝 Changes

  • New optional providerName parameter can be specified for both apn and firebase integrations.

  • Existing provider parameter in the PushDevice struct was renamed to pushProvider to gain API alignment with Android.

  • In order to have a way to test the to multi-bundle support, new DemoApp target was added to the integration apps repo with bundle identifier io.getstream.iOS.ChatDemoAppTwo.
    appstore

  • Additionally, a new Info section was added to our DemoApp to clarify which push configuration is used by our default develop app.
    Simulator

  • client property inside StreamChatWrapper is no longer forced-cast.

Important Note 📜

Docs will be added in separate PR, this PR contains only the implementation part.

🧪 Manual Testing Notes

  1. Build multi bundle app on multi-bundle branch in integration apps repo
  2. Send a message to Luke from a different app/web
  3. Verify the push notification is received.
    IMG_1087

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • This change follows zero ⚠️ policy (required)
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

🎁 Meme

Provide a funny gif or image that relates to your work on this pull request. (Optional)

@bielikb bielikb requested a review from a team as a code owner June 17, 2022 16:44
@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Jun 17, 2022

2 Errors
🚫 Please start subject with capital letter.
eaa8369
🚫 Please use more than one word.
ca2f82d

Generated by 🚫 Danger

@bielikb bielikb added the 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK label Jun 17, 2022
Copy link
Contributor

@evsaev evsaev left a comment

Choose a reason for hiding this comment

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

What if we just have another configuration (e.g. alpha) instead of 2nd target? Because that's the approach enterprise usually follows: they ship 1 app version for internal testing purposes via TestFlight and another app is a production app available in AppStore for end users. They have single target but multiple configurations which bundle identifier depends on

@bielikb
Copy link
Contributor Author

bielikb commented Jun 20, 2022

Usually you have separate targets per each type of app (staging, production). The separation of concerns via another app target for multi bundle app makes it easy to configure the build settings/phases the way they make sense for you. eg adding support for Firebase in MB target won't interfere with our main DemoApp target.

What if we just have another configuration (e.g. alpha) instead of 2nd target? Because that's the approach enterprise usually follows: they ship 1 app version for internal testing purposes via TestFlight and another app is a production app available in AppStore for end users. They have single target but multiple configurations which bundle identifier depends on

Copy link
Contributor

@evsaev evsaev left a comment

Choose a reason for hiding this comment

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

LGTM

@bielikb bielikb added the ✅ Feature An issue or PR related to a feature label Jun 20, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jun 20, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@bielikb bielikb merged commit e5668c8 into develop Jun 20, 2022
@bielikb bielikb deleted the feature/CIS-1900 branch June 20, 2022 16:35
@bielikb bielikb mentioned this pull request Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Feature An issue or PR related to a feature 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants