Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

User defined callout probability

Featured Replies

I know some callout plugins have achieved this. I was coding something that I thought would work to allow the users to set the callout probability until I realized that you attributes have to be constant values.

What is a way around this?

  • Author
On Friday, May 06, 2016 at 10:03 PM, ainesophaur said:

How were you having the users set the probability? What is the ideal scenario you'd like to achieve?

 

    [CalloutInfo("name", CalloutProbability.High)]  
    class name : Callout

I'd like to be able to dynamically define the probability, but as far as I know the only way is via an attribute in the class which has to be static.

 

So instead of CalloutProbability.High, it'd be a user defined value

 

I did not have the users set the probability as it wouldn't compile because it won't let attributes have values that are not constant

 

Is there an API change or something really obvious that I missed?

Edited by goigle

Off the top of my head, the probability that you see in the ini files of some plugins isn't dealing with the probability attribute. I'd guess they just set the probability to high and control whether to show or skip the callouts before it's shown to the user through code. The ini file probability are numerical so they're doing some sort of calculation.

From what I know from seeing logs what Albo does is register the same callout multiple times, for example if the user sets the probability to 3, register it three times.

I noticed this from see in the logs the same callout from Albo registered mulitple times, maybe he does something else internally but I can't confirm it.

1 hour ago, alexguirre said:

From what I know from seeing logs what Albo does is register the same callout multiple times, for example if the user sets the probability to 3, register it three times.

I noticed this from see in the logs the same callout from Albo registered mulitple times, maybe he does something else internally but I can't confirm it.

If that is true I wonder if there is any adverse affects from it? IE it stifles callouts that lspdfr selects and causes other callouts to be selected less

  • Management Team

You can register a dummy callout with Always as probability and then in your code decide whether or not to start that callout. You could also use the dummy to launch other callouts to have more control.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author
12 hours ago, LMS said:

You can register a dummy callout with Always as probability and then in your code decide whether or not to start that callout. You could also use the dummy to launch other callouts to have more control.

I imagine returning false in OnBeforeCalloutDisplayed() will then cause a different callout to be displayed, instead of nothing, correct?

 

Thanks everyone by the way! :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Similar Content

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.