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

Firebase App Invite integration #668

Merged
merged 27 commits into from
Sep 23, 2016
Merged

Firebase App Invite integration #668

merged 27 commits into from
Sep 23, 2016

Conversation

tasomaniac
Copy link
Member

@tasomaniac tasomaniac commented Sep 22, 2016

First of all, this turned out bigger than I expected. Sorry for that. 🙏

This PR adds new Firebase Invites API. Firebase Invites uses Dynamic Links internally which is where the magic occurs.

App Invite, on top of that, a UI where you can choose your friends to share. But it only includes sharing via SMS and Email. I really didn't like it. I think it is too restrictive.

Instead, I create dynamic links directly. Which then, user can choose whatever app they want to share.

I'm using https://gdg.events/invite/?sender=gplusid as link structure. This link will be opened if it is clicked in a computer.

If the app is already installed, it just opens the app.

If not, it installs the app and then in the login page, I put the picture and a welcome message there.
Since we have more info there now, I quickly add landscape version of the page.

Screenshots

Portrait Landscape
screenshot_1474578097 screenshot_1474580562

Fixes #637

Had to remove home gdg on the server. It is not really used and causing problems now.
- Invite button is added to NavDrawer that just creates a dynamic url.
- AppInvite related code from MainActivity is removed because it will be forwarded to AppInviteDeepLinkActivity by default using the deeplink.
The first page will be the welcome invite page. When we don't have invite, it will move on to the next page.
And windowBackground is set through themes
and remove old AppInviteDeepLinkActivity
Revert the changes in PlusUtils
Upgrade play services
Copy link
Contributor

@friedger friedger left a comment

Choose a reason for hiding this comment

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

nice

@@ -136,10 +136,11 @@ dependencies {
compile "com.android.support.test.espresso:espresso-idling-resource:$rootProject.espressoVersion"

//Play Services
compile "com.google.android.gms:play-services-auth:$rootProject.playServicesVersion"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need auth? It is not mentioned in the firebase integration documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

The piece of code that we have in Settings it's not working anymore. The class was removed. I first deleted that and realized that I can just add this dependency. The reason was the upgrade of the gms version.

private void shareAppInviteLink() {
AppInviteLinkGenerator linkGenerator = AppInviteLinkGenerator.create();
String gplusId = PlusUtils.getCurrentPersonId(getGoogleApiClient());
HttpUrl appInviteLink = gplusId != null
Copy link
Contributor

@friedger friedger Sep 23, 2016

Choose a reason for hiding this comment

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

AboutActivity should not decide on how to handle not signed users. This should go into the linkGenerator.

@@ -303,6 +312,19 @@ private void navigateTo(Class<? extends GdgActivity> activityClass, Bundle addit
mDrawerLayout.closeDrawers();
}

private void shareAppInviteLink() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate code, same as in AboutActivity

@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(INVITE_SENDER, inviteSender);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

.getPerson(inviteSender)
.enqueue(new Callback<Person>() {
@Override
public void success(Person sender) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we fail to load the sender then the invitation process stops here. We should still show the inviteContainer with a dummy image and a dummy name ("a friend" or so)

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally makes sense. We should do it.

<string name="invitation_error_message">App Invite was unsuccessful.</string>
<string name="thanks_for_feedback">Thank you for your Feedback!</string>
<string name="retry">Retry</string>
<string name="title_event_series_greetings">New events coming up!</string>
<string name="event_series_greetings">Learn more about %1$s and see events around the world!</string>
<string name="cd_invitation_sender_profile_image">Invitation sender profile image</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you upload the new strings to crowdin?

Copy link
Member Author

Choose a reason for hiding this comment

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

Strings are already upload/updated in crowdin.

@tasomaniac
Copy link
Member Author

@friedger comments are addressed. 👍

import android.os.Parcel;
import android.os.Parcelable;

class Invite implements Parcelable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you add this class? Is this "just" for giving String a meaning? Then sender should be gplusIdOfSender or so

@friedger friedger merged commit e835045 into develop Sep 23, 2016
@friedger friedger deleted the move/app_invite branch September 23, 2016 20:32
@tasomaniac
Copy link
Member Author

I did that to both provide a meaningful name and to handle 3 cases in 1
object.
String is not enough. We have 3 states.
No invite, invite without sender, invite with sender.

On Fri, Sep 23, 2016, 22:31 Friedger Müffke notifications@github.com
wrote:

@friedger commented on this pull request.

In app/src/main/java/org/gdg/frisbee/android/onboarding/Invite.java
#668 (review):

@@ -0,0 +1,38 @@
+package org.gdg.frisbee.android.onboarding;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+class Invite implements Parcelable {

Why do you add this class? Is this "just" for giving String a meaning?
Then sender should be gplusIdOfSender or so


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#668 (review), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAulyyAT2gqBBxq7Harj7Df-U354sXfLks5qtDcygaJpZM4KEbdH
.

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

2 participants