branch.io redirects to empty content in app, if app is not running in background -


errorimplemented branch.io in application. working fine except if app not running in background , branch.io link clicked. open app , redirect screen shared content shown showing empty screen or no content on screen.if app running in background works fine. why limitation or missing something. please guide, in advance.

posting code clarity.

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {  sleep(5);  articlesdetailviewcontroller *controller = [[uistoryboard storyboardwithname:@"main" bundle:[nsbundle mainbundle]] instantiateviewcontrollerwithidentifier:@"articlesdetail"];  branch *branch = [branch getinstance]; [branch registerdeeplinkcontroller:controller forkey:@"screenarticle"]; [branch initsessionwithlaunchoptions:launchoptions automaticallydisplaydeeplinkcontroller:yes]; }  //  controller redirected.  - (void)configurecontrolwithdata:(nsdictionary *)data { nsstring *pictureurl = data[@"screenarticle"];  isbranch = 1;  strdate = data[@"createddate"]; self.lbldate.text = [strdate uppercasestring]; self.lbltitle.text = data[@"title"]; strdesc = data[@"description"]; [self.txtdescription sizetofit]; [self.txtdescription.textcontainer setsize:self.txtdescription.frame.size];  nsstring *strprefont = @"<font face=\"avenir next\" color=\"#fff\" size=\"5\">";  nsstring *strpost = @"</font>"; nsstring *htmlstring = [nsstring stringwithformat:@"%@%@%@", strprefont, strdesc, strpost]; nsattributedstring *attributedstring = [[nsattributedstring alloc] initwithdata:[htmlstring datausingencoding:nsutf16stringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; self.txtdescription.attributedtext = attributedstring;  strimgurl = data[@"imagename"]; [self.imgheader sd_setimagewithurl:[nsurl urlwithstring:strimgurl] placeholderimage:[uiimage imagenamed:@"dummyimagefeaturedfirst"]];  // show picture dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{     nsdata *imagedata = [nsdata datawithcontentsofurl:[nsurl urlwithstring:pictureurl]];     uiimage *image = [uiimage imagewithdata:imagedata];     dispatch_async(dispatch_get_main_queue(), ^{         //self.productimageview.image = image;         nslog(@"got image");     }); }); }  - (ibaction)closepressed { [self.deeplinkingcompletiondelegate deeplinkingcontrollercompleted]; }  - (void)viewdidload { [super viewdidload]; // additional setup after loading view.  mixpanel = [mixpanel sharedinstance];  if(isbranch) {  } else {     self.lbldate.text = [strdate uppercasestring];     self.lbltitle.text = strtitle;     //self.txtdescription.text = strdesc;      [self.txtdescription sizetofit];     [self.txtdescription.textcontainer setsize:self.txtdescription.frame.size];      nsstring *strprefont = @"<font face=\"avenir next\" color=\"#fff\" size=\"5\">";      nsstring *strpost = @"</font>";     nsstring *htmlstring = [nsstring stringwithformat:@"%@%@%@", strprefont, strdesc, strpost];     nsattributedstring *attributedstring = [[nsattributedstring alloc] initwithdata:[htmlstring datausingencoding:nsutf16stringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil];     self.txtdescription.attributedtext = attributedstring;      [self.imgheader sd_setimagewithurl:[nsurl urlwithstring:strimgurl] placeholderimage:[uiimage imagenamed:@"dummyimagefeaturedfirst"]]; } } 

i'm using initsessionwithlaunchoptions in didfinishlaunchingwithoptions

like .. code in swift language

let branch: branch = branch.getinstance() branch.initsessionwithlaunchoptions(launchoptions, andregisterdeeplinkhandler: { params, error in  {       if let _ = params {           if params["video_id"] != nil{             let videoid = params["video_id"] as! string             print("brach data printing \(videoid)")            //get data here , redirect .             //i'm getting video_id deeplinking.            }       }    } }) 

if have problem in swift understanding comment here i'll convert in objective-c .

i'm not using other function redirecting . wrote down code in section , work .


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -