딥 링크를 사용하여 GWT 역사를 토큰에 Facebook iFrame 캔버스

StackOverflow https://stackoverflow.com/questions/2457994

  •  20-09-2019
  •  | 
  •  

문제

나는 깊은 링크를 직접 GWT 응용 프로그램 페이지에 Facebook iFrame 캔버스입니다.

첫 번째 부분은 사용하여 간단한 GWT 의 역사를 토큰으로 Url 을 다음과 같:

http://www.example.com/MyApp/#page1

는 page1 이내에 내 응용 프로그램.

Facebook 앱 응용 프로그램을 사용하여 url 을 다음과 같:

http://apps.facebook.com/myAppName

는 프레임 내 캔버스 콜백 URL

http://www.example.com/MyApp/

방법은 없을 지정하는 캔버스 콜백 url(또는 북마크한 url)는 사용자를 특정 페이지가 아닌 인덱스 페이지?

왜?요청할 수 있습니다.게다가 모든 혜택의 깊은 링크...

  • 내가 원하는"가서 응용 프로그램을"url 을하고 사용자는 인덱스 페이지로 w/마케팅 자료(캔버스 콜백 url)

  • 고 싶은"북마크한 URL"를(가 반환)사용자를 로그인 페이지로 바이패스 다운로드 콘텐츠 마케팅(는 거대한 SWF 파일)입니다.

도움이 되었습니까?

해결책

이 될 것처럼 보일 수 있습니다 하지만 해킹 here it goes.

Facebook 를 사용하면 응용 프로그램을 압정에서 매개 변수 url?x=123

그래서 저는 확인 창에 위치하는 경우 포함되는 특별한 페이지수와 로드하는 페이지입니다.아래는 내가 주어진 솔루션을 사용하는 GWT+gwt-발표자의 PlaceManager 클래스입니다.

응용 프로그램 깊은 url 인 끝 http://apps.facebook.com/myAppName?page=page1

    EventBus eventBus = injector.getEventBus();

    // Load PlaceManager so it can start listening
    PlaceManager placeManager = injector.getPlaceManager();
    String currentPlace = History.getToken();

    String place = Window.Location.getParameter( "page" );
    if (place != null && !place.isEmpty()) {
        // send user to the place on the URL line
        eventBus.fireEvent( new PlaceRequestEvent( new PlaceRequest( new Place (place) ) ));

    } else if ("".equals(currentPlace)) {
        // Nothing in URL, load default GWTpage
        eventBus.fireEvent( new PlaceRequestEvent(new PlaceRequest( IndexPresenter.PLACE)));

    } else {
        // fire a body to the Place Manager to activate the requsted Place
        placeManager.fireCurrentPlace();
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top