use of com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry in project DeepLinkDispatch by airbnb.
the class DeepLinkActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Debug.startMethodTracing("deeplink.trace",90000000);
Map configurablePlaceholdersMap = new HashMap();
configurablePlaceholdersMap.put("configPathOne", "somePathThree");
configurablePlaceholdersMap.put("configurable-path-segment-one", "");
configurablePlaceholdersMap.put("configurable-path-segment", "");
configurablePlaceholdersMap.put("configurable-path-segment-two", "");
configurablePlaceholdersMap.put("configPathOne", "somePathOne");
DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new SampleModuleRegistry(), new LibraryDeepLinkModuleRegistry(), new BenchmarkDeepLinkModuleRegistry(), new KaptLibraryDeepLinkModuleRegistry(), configurablePlaceholdersMap);
deepLinkDelegate.dispatchFrom(this);
// Debug.stopMethodTracing();
finish();
}
use of com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry in project DeepLinkDispatch by airbnb.
the class MainActivityTest method testSameLengthComponentsMismatch.
@Test
public void testSameLengthComponentsMismatch() throws Exception {
Map<String, String> configurablePathSegmentReplacements = new HashMap<>();
configurablePathSegmentReplacements.put("configurable-path-segment", "obamaOs");
configurablePathSegmentReplacements.put("configurable-path-segment-one", "belong");
configurablePathSegmentReplacements.put("configurable-path-segment-two", "anywhere");
DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new SampleModuleRegistry(), new LibraryDeepLinkModuleRegistry(), new BenchmarkDeepLinkModuleRegistry(), new KaptLibraryDeepLinkModuleRegistry(), configurablePathSegmentReplacements);
assertThat(deepLinkDelegate.supportsUri("dld://classDeepLink"), equalTo(true));
assertThat(deepLinkDelegate.supportsUri("dld://classDeepLinx"), equalTo(false));
}
use of com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry in project DeepLinkDispatch by airbnb.
the class MainActivityTest method testConfigurablePathSegmentMatch.
@Test
public void testConfigurablePathSegmentMatch() {
Map<String, String> configurablePathSegmentReplacements = new HashMap<>();
configurablePathSegmentReplacements.put("configurable-path-segment", "obamaOs");
configurablePathSegmentReplacements.put("configurable-path-segment-one", "belong");
configurablePathSegmentReplacements.put("configurable-path-segment-two", "anywhere");
DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new SampleModuleRegistry(), new LibraryDeepLinkModuleRegistry(), new BenchmarkDeepLinkModuleRegistry(), new KaptLibraryDeepLinkModuleRegistry(), configurablePathSegmentReplacements);
assertThat(deepLinkDelegate.supportsUri("https://www.example.com/capnMcCains/bar"), equalTo(false));
assertThat(deepLinkDelegate.supportsUri("https://www.example.com/obamaOs/bar"), equalTo(true));
}
Aggregations