Android Question why #if Release doesn't work

alimanam3386

Active Member
Licensed User
Longtime User
Hi , I have bellow code in a module :

B4X:
Public Sub GetShareLink As String
  #if GOOGLE
      Return "https://play.google.com/store/apps/details?id=..."
  #Else
      Return "https://cafebazaar.ir/app/..."
  #End If
End Sub

234234.jpg


also in Build Configurations I defined two configuration ( GOOGLE AND OTHER ) but when I try to call this sub ( GetShareLink ) always I get same result ( "https://cafebazaar.ir/app/..." ) even when I change the build configuration to OTHER OR GOOGLE I get same result , why ?
 
Last edited:

angel_

Well-Known Member
Licensed User
Longtime User
Try this:
B4X:
Public Sub GetShareLink As String
  #if GOOGLE
      Return "https://play.google.com/store/apps/details?id=..."
  #Else if NOT(GOOGLE)
      Return "https://cafebazaar.ir/app/..."
  #End If
End Sub
 
Upvote 0

alimanam3386

Active Member
Licensed User
Longtime User
I confused o_O:rolleyes: It worked once but now I still have problem with that again!
 

Attachments

  • TEST.zip
    8.2 KB · Views: 147
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
works nice thanks , so we should not separate the conditional symbols with comma for any build configuration right ?
No, por example if you want this
B4X:
    #If NO_ADS
        #if GOOGLE
            Return "https://play.google.com/store/apps/details?id=com.porshesoft.oneaye"
        #Else
            Return "https://cafebazaar.ir/app/com.porshesoft.oneaye"
        #End If
    #Else
        Return "https://..."
    #End If

GOOGLE: GOOGLE, NO_ADS
CAFEBAZAAR: CAFEBAZAAR, NO_ADS
 
Upvote 0
Top