• Resolved Manuel Marquez

    (@manudeoli)


    Hi Murali,

    When I click on a push notification on mobile, the browser lands us at the top of the thread and not at the specific location of the comment. It would be great if we could go directly to the comment, without having to scroll to find the comment

    Is this possible?

    (browser used : chrome with the latest version of the PNPB’s plugin)

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Murali

    (@murali-indiacitys)

    We cannot control scroll from push notification link but we can open the link

    There is function bp_activity_comment_permalink, i will change it to open comment link directly. This will also scroll down the page to appropriate comment. I will do this in next release (later this week)

    Example, comment link will look like this, it will scroll down to comment to 496, i will include this change in next release

    https://www.muraliwebworld.com/members/joselawrence/activity/494/#acomment-496

    • This reply was modified 2 years, 2 months ago by Murali.
    Thread Starter Manuel Marquez

    (@manudeoli)

    Thanks a lot ! Have a nice day

    Thread Starter Manuel Marquez

    (@manudeoli)

    Hi Murali,

    Have you had time to look into it?

    Plugin Author Murali

    (@murali-indiacitys)

    This change will be in 1.50 version . Due to lot of following other changes in 1.50 version, testing took long time and i completed testing today. I am planning to release it tomorrow. For your requirement, i can include only comment link but scrolling will needs to be in the site theme css, it cannot be controlled in notification link. Following are list of changes going to be in 1.50 release

    1. Action scheduler to process more than 1000 subscribers in more than one queue with 1000 subscribers each in background mode. Since Firebase accepts 1000 deviceids per send, action scheduler will be included in upcoming release to schedule in queue (1000 device ids each queue). It will process in asynchronous way to reduce server load.
    2. Private message Thread id for mobile app in notification under data to open private message thread directly in mobile app using deep link
    3. Activity comment link update in notification
    4. Search button in Device tokens list admin panel to search user id and tokens
    5. Clearing of stale/invalid tokens for webview mobile apps. For websites, this logic is already present.
    6. On demand push notification panel changes to include image link and click action link
    7. Removed character limit in on demand push notification
    8. DB table changes to include web_auth and web_256 fields in database for future use incase if users wants to migrate tokens from other push service providers
    9. Fixed problems related to post title while scheduling notifications for POST
    10. Javascript routine to receive tokens from android java app using webview javascript interface
    11. New admin tab for scheduled actions in background
    Plugin Author Murali

    (@murali-indiacitys)

    Hi

    I.50 version released. Activity comment push link will ending with #<commentid>, but we have to use html { scroll-behaviour: smooth; } to scroll but still i am not sure it will scroll to <li> tag with comment id. It can only be controlled in your theme, push notification click link contains section id of comment id from 1.50 version onwards

    Thread Starter Manuel Marquez

    (@manudeoli)

    Hi,

    Nice work, thanks !

    It works with my template (buddyx) ! However, I had to desactivate the fixed header, because after cliking, the comment is now too high and hidden. I did not find the solution to resolve this with css, because each comment have an unique id. Do you have an idea how to resolve this problem ?

    Plugin Author Murali

    (@murali-indiacitys)

    I think if we use css html { scroll-behaviour: smooth; }? in theme stylesheet or custom css in theme then whenever anchor link contains #sectionname then it will scroll down to corresponding section. For activity comment push click link, this plugin will send push notification with click link – activity link ending with #<commentid>, since we are clicking this link from push notification, i am not sure it will work properly to scroll to corresponding section (comment id in <li> tag). From the plugin we can get only activity link with comment id which got new comment , it is difficult to control scrolling. As per my search in google, i found only above css html { scroll-behaviour: smooth; } which needs to be in theme css/custom css. If I find any other solution to include it in css, i will let you know. Thanks Murali

    Thread Starter Manuel Marquez

    (@manudeoli)

    Yes, the scroll is done well. But after clicking, the fixed header of the buddyx template hides the comment, even with property { scroll-behaviour: smooth; }. Example : https://codepen.io/cferdinandi/pen/vYOZMRN

    Maybe there would be an answer here, with the scroll-margin-top property? https://gomakethings.com/how-to-prevent-anchor-links-from-scrolling-behind-a-sticky-header-with-one-line-of-css/

    But I don’t know which selector to put in css. I tried with .acomment-content {scroll-margin-top: 80px;}, but it doesn’t work.

    Plugin Author Murali

    (@murali-indiacitys)

    In Buddyx theme, comment is under <li> with id=<comment id> not in href, i am also using buddyx theme in my site, I will try and let you know, if i find anything on scrolling. Thanks.

    Thread Starter Manuel Marquez

    (@manudeoli)

    thanks !

    Plugin Author Murali

    (@murali-indiacitys)

    Try this jquery , it will scroll down to appropriate comment id while visiting from push notification link containing hash tag. Problem is, comment html tags are loaded dynamically in BuddyPress as well as in Buddyx theme. Since these are dynamically added elements, we need to wait until entire page is loaded and then we need to scrolltop to move to appropriate position. Please use this jquery in javascript in header then it will scroll down. I will try to add this scroll in plugin javascript itself in next release

    In below jquery code, if window.location.hash – contains # symbol then it will wait for sometime to load everything and scrolltop using animation to appropriate offset

    
    	if ((window.location.hash).length > 1) {
    	    let interval = setInterval(() => 
        	{
            	let el = document.querySelector(window.location.hash);
            	if (el)
            	{
    	 			 		$j("html, body").animate({
       				 		scrollTop: $j(window.location.hash).offset().top
      					}, 1000);
                	clearInterval(interval);
            	}
        	}, 100);
    	}

    • This reply was modified 2 years, 2 months ago by Murali.
    Thread Starter Manuel Marquez

    (@manudeoli)

    It works fine ! thank you very much !

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘direct access to mobile thread when clicking on push notification’ is closed to new replies.