DynamicLinking V1
Dynamic linking eingebaut in LoginActivity
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								.idea/caches/gradle_models.ser
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.idea/caches/gradle_models.ser
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -42,4 +42,5 @@ dependencies {
 | 
				
			|||||||
    implementation 'com.android.support:recyclerview-v7:28.0.0'
 | 
					    implementation 'com.android.support:recyclerview-v7:28.0.0'
 | 
				
			||||||
    implementation 'com.android.support:support-v4:28.0.0'
 | 
					    implementation 'com.android.support:support-v4:28.0.0'
 | 
				
			||||||
    implementation 'cz.msebera.android:httpclient:4.4.1.2'
 | 
					    implementation 'cz.msebera.android:httpclient:4.4.1.2'
 | 
				
			||||||
 | 
					    implementation 'com.google.firebase:firebase-dynamic-links:16.1.7'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,37 +6,6 @@
 | 
				
			|||||||
    "storage_bucket": "test-667ca.appspot.com"
 | 
					    "storage_bucket": "test-667ca.appspot.com"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "client": [
 | 
					  "client": [
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "client_info": {
 | 
					 | 
				
			||||||
        "mobilesdk_app_id": "1:221332577314:android:acb28f092122eb64",
 | 
					 | 
				
			||||||
        "android_client_info": {
 | 
					 | 
				
			||||||
          "package_name": "at.smartshopper.smartshopper"
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "oauth_client": [
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          "client_id": "221332577314-oo8b4uqtlgj75e7u7o3qt1vc96prfv52.apps.googleusercontent.com",
 | 
					 | 
				
			||||||
          "client_type": 3
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      ],
 | 
					 | 
				
			||||||
      "api_key": [
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          "current_key": "AIzaSyDz7MzopErZ6paAIaGGJAGY8Lx9kly5q2k"
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      ],
 | 
					 | 
				
			||||||
      "services": {
 | 
					 | 
				
			||||||
        "analytics_service": {
 | 
					 | 
				
			||||||
          "status": 1
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "appinvite_service": {
 | 
					 | 
				
			||||||
          "status": 1,
 | 
					 | 
				
			||||||
          "other_platform_oauth_client": []
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "ads_service": {
 | 
					 | 
				
			||||||
          "status": 2
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "client_info": {
 | 
					      "client_info": {
 | 
				
			||||||
        "mobilesdk_app_id": "1:221332577314:android:33ebe9c1c19a0a72",
 | 
					        "mobilesdk_app_id": "1:221332577314:android:33ebe9c1c19a0a72",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@
 | 
				
			|||||||
        android:usesCleartextTraffic="true">
 | 
					        android:usesCleartextTraffic="true">
 | 
				
			||||||
        <activity
 | 
					        <activity
 | 
				
			||||||
            android:name="at.smartshopper.smartshopperapp.activitys.EditUser"
 | 
					            android:name="at.smartshopper.smartshopperapp.activitys.EditUser"
 | 
				
			||||||
            android:label="@string/title_activity_edit_user"></activity>
 | 
					            android:label="@string/title_activity_edit_user"/>
 | 
				
			||||||
        <activity android:name="at.smartshopper.smartshopperapp.activitys.DoneItemActivity" />
 | 
					        <activity android:name="at.smartshopper.smartshopperapp.activitys.DoneItemActivity" />
 | 
				
			||||||
        <activity
 | 
					        <activity
 | 
				
			||||||
            android:name="at.smartshopper.smartshopperapp.activitys.ItemListActivity"
 | 
					            android:name="at.smartshopper.smartshopperapp.activitys.ItemListActivity"
 | 
				
			||||||
@@ -26,6 +26,14 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                <category android:name="android.intent.category.LAUNCHER" />
 | 
					                <category android:name="android.intent.category.LAUNCHER" />
 | 
				
			||||||
            </intent-filter>
 | 
					            </intent-filter>
 | 
				
			||||||
 | 
					            <intent-filter>
 | 
				
			||||||
 | 
					                <action android:name="android.intent.action.VIEW"/>
 | 
				
			||||||
 | 
					                <category android:name="android.intent.category.DEFAULT"/>
 | 
				
			||||||
 | 
					                <category android:name="android.intent.category.BROWSABLE"/>
 | 
				
			||||||
 | 
					                <data
 | 
				
			||||||
 | 
					                    android:host="smartshopper.cf"
 | 
				
			||||||
 | 
					                    android:scheme="https"/>
 | 
				
			||||||
 | 
					            </intent-filter>
 | 
				
			||||||
        </activity>
 | 
					        </activity>
 | 
				
			||||||
        <activity
 | 
					        <activity
 | 
				
			||||||
            android:name="at.smartshopper.smartshopperapp.activitys.Dash"
 | 
					            android:name="at.smartshopper.smartshopperapp.activitys.Dash"
 | 
				
			||||||
@@ -55,6 +63,7 @@
 | 
				
			|||||||
        <activity
 | 
					        <activity
 | 
				
			||||||
            android:name="at.smartshopper.smartshopperapp.activitys.ShoppinglistDetails"
 | 
					            android:name="at.smartshopper.smartshopperapp.activitys.ShoppinglistDetails"
 | 
				
			||||||
            android:label="@string/title_activity_shoppinglist_details" />
 | 
					            android:label="@string/title_activity_shoppinglist_details" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </application>
 | 
					    </application>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</manifest>
 | 
					</manifest>
 | 
				
			||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
package at.smartshopper.smartshopperapp.activitys;
 | 
					package at.smartshopper.smartshopperapp.activitys;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import android.content.Intent;
 | 
					import android.content.Intent;
 | 
				
			||||||
 | 
					import android.net.Uri;
 | 
				
			||||||
import android.os.Bundle;
 | 
					import android.os.Bundle;
 | 
				
			||||||
import android.os.Handler;
 | 
					import android.os.Handler;
 | 
				
			||||||
import android.support.annotation.NonNull;
 | 
					import android.support.annotation.NonNull;
 | 
				
			||||||
@@ -19,12 +20,16 @@ import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
 | 
				
			|||||||
import com.google.android.gms.common.SignInButton;
 | 
					import com.google.android.gms.common.SignInButton;
 | 
				
			||||||
import com.google.android.gms.common.api.ApiException;
 | 
					import com.google.android.gms.common.api.ApiException;
 | 
				
			||||||
import com.google.android.gms.tasks.OnCompleteListener;
 | 
					import com.google.android.gms.tasks.OnCompleteListener;
 | 
				
			||||||
 | 
					import com.google.android.gms.tasks.OnFailureListener;
 | 
				
			||||||
 | 
					import com.google.android.gms.tasks.OnSuccessListener;
 | 
				
			||||||
import com.google.android.gms.tasks.Task;
 | 
					import com.google.android.gms.tasks.Task;
 | 
				
			||||||
import com.google.firebase.auth.AuthCredential;
 | 
					import com.google.firebase.auth.AuthCredential;
 | 
				
			||||||
import com.google.firebase.auth.AuthResult;
 | 
					import com.google.firebase.auth.AuthResult;
 | 
				
			||||||
import com.google.firebase.auth.FirebaseAuth;
 | 
					import com.google.firebase.auth.FirebaseAuth;
 | 
				
			||||||
import com.google.firebase.auth.FirebaseUser;
 | 
					import com.google.firebase.auth.FirebaseUser;
 | 
				
			||||||
import com.google.firebase.auth.GoogleAuthProvider;
 | 
					import com.google.firebase.auth.GoogleAuthProvider;
 | 
				
			||||||
 | 
					import com.google.firebase.dynamiclinks.FirebaseDynamicLinks;
 | 
				
			||||||
 | 
					import com.google.firebase.dynamiclinks.PendingDynamicLinkData;
 | 
				
			||||||
import com.google.firebase.iid.FirebaseInstanceId;
 | 
					import com.google.firebase.iid.FirebaseInstanceId;
 | 
				
			||||||
import com.google.firebase.iid.InstanceIdResult;
 | 
					import com.google.firebase.iid.InstanceIdResult;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -47,6 +52,36 @@ public class LoginActivity extends AppCompatActivity {
 | 
				
			|||||||
    //Für Double Back press to exit
 | 
					    //Für Double Back press to exit
 | 
				
			||||||
    private boolean doubleBackToExitPressedOnce = false;
 | 
					    private boolean doubleBackToExitPressedOnce = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void getDynamicLink(){
 | 
				
			||||||
 | 
					        FirebaseDynamicLinks.getInstance()
 | 
				
			||||||
 | 
					                .getDynamicLink(getIntent())
 | 
				
			||||||
 | 
					                .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
 | 
				
			||||||
 | 
					                    @Override
 | 
				
			||||||
 | 
					                    public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
 | 
				
			||||||
 | 
					                        // Get deep link from result (may be null if no link is found)
 | 
				
			||||||
 | 
					                        Uri deepLink = null;
 | 
				
			||||||
 | 
					                        if (pendingDynamicLinkData != null) {
 | 
				
			||||||
 | 
					                            deepLink = pendingDynamicLinkData.getLink();
 | 
				
			||||||
 | 
					                            Log.d("SmartShopper", deepLink.toString());
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // Handle the deep link. For example, open the linked
 | 
				
			||||||
 | 
					                        // content, or apply promotional credit to the user's
 | 
				
			||||||
 | 
					                        // account.
 | 
				
			||||||
 | 
					                        // ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // ...
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
 | 
					                .addOnFailureListener(this, new OnFailureListener() {
 | 
				
			||||||
 | 
					                    @Override
 | 
				
			||||||
 | 
					                    public void onFailure(@NonNull Exception e) {
 | 
				
			||||||
 | 
					                        Log.w(TAG, "getDynamicLink:onFailure", e);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
 | 
					    public void onActivityResult(int requestCode, int resultCode, Intent data) {
 | 
				
			||||||
        super.onActivityResult(requestCode, resultCode, data);
 | 
					        super.onActivityResult(requestCode, resultCode, data);
 | 
				
			||||||
@@ -190,6 +225,8 @@ public class LoginActivity extends AppCompatActivity {
 | 
				
			|||||||
        mAuth = FirebaseAuth.getInstance();
 | 
					        mAuth = FirebaseAuth.getInstance();
 | 
				
			||||||
        db = new Database();
 | 
					        db = new Database();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        getDynamicLink();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Button loginEmailBtn = (Button) findViewById(R.id.loginEmailBtn);
 | 
					        Button loginEmailBtn = (Button) findViewById(R.id.loginEmailBtn);
 | 
				
			||||||
        final TextView email = (TextView) findViewById(R.id.email);
 | 
					        final TextView email = (TextView) findViewById(R.id.email);
 | 
				
			||||||
        final TextView passwort = (TextView) findViewById(R.id.password);
 | 
					        final TextView passwort = (TextView) findViewById(R.id.password);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user